Skip to content

Commit b86929c

Browse files
committed
...
1 parent 1aae1df commit b86929c

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

datetime/src/test/java/com/fasterxml/jackson/datatype/jsr310/deser/LocalDateDeserTest.java

+12-10
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,10 @@ public void testDeserializationCaseInsensitiveDisabled_InvalidDate() throws Thro
372372
*/
373373
@Test
374374
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();
378379

379380
assertEquals("The value is not correct.", LocalDate.of(1970, Month.MAY, 04),
380381
mapper.readValue("123", LocalDate.class));
@@ -383,9 +384,10 @@ public void testLenientDeserializeFromNumberInt() throws Exception {
383384
@Test
384385
public void testStrictDeserializeFromNumberInt() throws Exception
385386
{
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();
389391

390392
ShapeWrapper w = mapper.readValue("{\"date\":123}", ShapeWrapper.class);
391393
LocalDate localDate = w.date;
@@ -397,10 +399,10 @@ public void testStrictDeserializeFromNumberInt() throws Exception
397399
@Test(expected = MismatchedInputException.class)
398400
public void testStrictDeserializeFromString() throws Exception
399401
{
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();
404406
mapper.readValue("{\"value\":123}", Wrapper.class);
405407
}
406408

0 commit comments

Comments
 (0)