Skip to content

Commit 9e73c85

Browse files
committed
fix unit test (2.x vs 3.x incompat)
1 parent 74fe81f commit 9e73c85

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ public void testWithCustomFormat() throws Exception
7676
@Test
7777
public void testWithFormatViaConfigOverride() throws Exception
7878
{
79-
ObjectMapper mapper = newMapper();
80-
mapper.configOverride(Year.class)
81-
.setFormat(JsonFormat.Value.forPattern("'X'yyyy"));
79+
ObjectMapper mapper = newMapperBuilder()
80+
.withConfigOverride(Year.class,
81+
vc -> vc.setFormat((JsonFormat.Value.forPattern("'X'yyyy"))))
82+
.build();
8283
Year input = Year.of(2018);
8384
String json = mapper.writeValueAsString(input);
8485
assertEquals("\"X2018\"", json);

0 commit comments

Comments
 (0)