@@ -140,12 +140,10 @@ public void testSingleValueArrayDeserialization() throws Exception
140
140
@ Test
141
141
public void testExceptionCauseDeserialization () throws Exception
142
142
{
143
- ObjectMapper mapper = new ObjectMapper ();
144
-
145
143
final IOException exp = new IOException ("the outer exception" , new Throwable ("the cause" ));
146
144
147
- final String value = mapper .writeValueAsString (exp );
148
- final IOException act = mapper .readValue (value , IOException .class );
145
+ final String value = MAPPER .writeValueAsString (exp );
146
+ final IOException act = MAPPER .readValue (value , IOException .class );
149
147
150
148
assertNotNull (act .getCause ());
151
149
assertEquals (exp .getCause ().getMessage (), act .getCause ().getMessage ());
@@ -155,13 +153,11 @@ public void testExceptionCauseDeserialization() throws Exception
155
153
@ Test
156
154
public void testSuppressedGenericThrowableDeserialization () throws Exception
157
155
{
158
- ObjectMapper mapper = new ObjectMapper ();
159
-
160
156
final IOException exp = new IOException ("the outer exception" );
161
157
exp .addSuppressed (new Throwable ("the suppressed exception" ));
162
158
163
- final String value = mapper .writeValueAsString (exp );
164
- final IOException act = mapper .readValue (value , IOException .class );
159
+ final String value = MAPPER .writeValueAsString (exp );
160
+ final IOException act = MAPPER .readValue (value , IOException .class );
165
161
166
162
assertNotNull (act .getSuppressed ());
167
163
assertEquals (1 , act .getSuppressed ().length );
0 commit comments