@@ -372,9 +372,10 @@ public void testDeserializationCaseInsensitiveDisabled_InvalidDate() throws Thro
372
372
*/
373
373
@ Test
374
374
public void testLenientDeserializeFromNumberInt () throws Exception {
375
- ObjectMapper mapper = newMapper ();
376
- mapper .configOverride (LocalDate .class )
377
- .setFormat (JsonFormat .Value .forShape (JsonFormat .Shape .NUMBER_INT ));
375
+ ObjectMapper mapper = newMapperBuilder ()
376
+ .withConfigOverride (LocalDate .class ,
377
+ o -> o .setFormat (JsonFormat .Value .forShape (JsonFormat .Shape .NUMBER_INT )))
378
+ .build ();
378
379
379
380
assertEquals ("The value is not correct." , LocalDate .of (1970 , Month .MAY , 04 ),
380
381
mapper .readValue ("123" , LocalDate .class ));
@@ -383,9 +384,10 @@ public void testLenientDeserializeFromNumberInt() throws Exception {
383
384
@ Test
384
385
public void testStrictDeserializeFromNumberInt () throws Exception
385
386
{
386
- ObjectMapper mapper = newMapper ();
387
- mapper .configOverride (LocalDate .class )
388
- .setFormat (JsonFormat .Value .forLeniency (false ));
387
+ ObjectMapper mapper = newMapperBuilder ()
388
+ .withConfigOverride (LocalDate .class ,
389
+ o -> o .setFormat (JsonFormat .Value .forLeniency (false )))
390
+ .build ();
389
391
390
392
ShapeWrapper w = mapper .readValue ("{\" date\" :123}" , ShapeWrapper .class );
391
393
LocalDate localDate = w .date ;
@@ -397,10 +399,10 @@ public void testStrictDeserializeFromNumberInt() throws Exception
397
399
@ Test (expected = MismatchedInputException .class )
398
400
public void testStrictDeserializeFromString () throws Exception
399
401
{
400
- ObjectMapper mapper = newMapper ();
401
- mapper . configOverride (LocalDate .class )
402
- .setFormat (JsonFormat .Value .forLeniency (false ));
403
-
402
+ ObjectMapper mapper = newMapperBuilder ()
403
+ . withConfigOverride (LocalDate .class ,
404
+ o -> o .setFormat (JsonFormat .Value .forLeniency (false )))
405
+ . build ();
404
406
mapper .readValue ("{\" value\" :123}" , Wrapper .class );
405
407
}
406
408
0 commit comments