@@ -194,7 +194,8 @@ public void testDeserializationFromString01() throws Exception
194194 value = READER .readValue ('"' + time .toString () + '"' );
195195 assertEquals (time , value , "The value is not correct." );
196196
197- expectSuccess (OffsetTime .of (12 , 0 , 0 , 0 , ZoneOffset .UTC ), "'12:00Z'" );
197+ assertEquals (OffsetTime .of (12 , 0 , 0 , 0 , ZoneOffset .UTC ),
198+ READER .readValue (a2q ("'12:00Z'" )));
198199 }
199200
200201 @ Test
@@ -272,7 +273,7 @@ public void testDeserOfArrayOf() throws Exception
272273 public void testDeserializationAsArrayDisabled () throws Throwable
273274 {
274275 try {
275- read ( "['12:00Z']" );
276+ READER . readValue ( a2q ( "['12:00Z']" ) );
276277 fail ("expected MismatchedInputException" );
277278 } catch (MismatchedInputException e ) {
278279 // not the greatest error message...
@@ -284,15 +285,15 @@ public void testDeserializationAsArrayDisabled() throws Throwable
284285 public void testDeserializationAsEmptyArrayDisabled () throws Throwable
285286 {
286287 // works even without the feature enabled
287- assertNull (read ( "[]" ));
288+ assertNull (READER . readValue ( a2q ( "[]" ) ));
288289 }
289290
290291 @ Test
291292 public void testDeserializationAsArrayEnabled () throws Throwable
292293 {
293294 OffsetTime value = READER .with (DeserializationFeature .UNWRAP_SINGLE_VALUE_ARRAYS )
294295 .readValue (a2q ("['12:00Z']" ));
295- expect (OffsetTime .of (12 , 0 , 0 , 0 , ZoneOffset .UTC ), value );
296+ assertEquals (OffsetTime .of (12 , 0 , 0 , 0 , ZoneOffset .UTC ), value );
296297 }
297298
298299 @ Test
@@ -346,18 +347,4 @@ public void testStrictDeserializeFromEmptyString() throws Exception {
346347 String valueFromEmptyStr = mapper .writeValueAsString (asMap (key , "" ));
347348 assertThrows (MismatchedInputException .class , () -> objectReader .readValue (valueFromEmptyStr ));
348349 }
349-
350- private void expectSuccess (Object exp , String json ) throws IOException {
351- final OffsetTime value = read (json );
352- assertNotNull (value , "The value should not be null." );
353- assertEquals (exp , value , "The value is not correct." );
354- }
355-
356- private OffsetTime read (final String json ) throws IOException {
357- return READER .readValue (a2q (json ));
358- }
359-
360- private static void expect (Object exp , Object value ) {
361- assertEquals (exp , value , "The value is not correct." );
362- }
363350}
0 commit comments