Skip to content

Commit 6bca25f

Browse files
committed
Clean up post #3655 (to keep tests compiling with J3 too)
1 parent a2a86c2 commit 6bca25f

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/test/java/com/fasterxml/jackson/databind/deser/creators/EnumCreatorTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,19 +357,21 @@ public void testPropertyCreatorEnum3280() throws Exception
357357
// for [databind#3655]
358358
public void testEnumsFromIntsUnwrapped() throws Exception
359359
{
360-
Object ob = newJsonMapper()
361-
.enable(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
362-
.readValue("[1]", TestEnumFromInt.class);
360+
Object ob = MAPPER
361+
.readerFor(TestEnumFromInt.class)
362+
.with(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
363+
.readValue("[1]");
363364
assertEquals(TestEnumFromInt.class, ob.getClass());
364365
assertSame(TestEnumFromInt.ENUM_A, ob);
365366
}
366367

367368
// for [databind#3655]
368369
public void testEnumsFromStringUnwrapped() throws Exception
369370
{
370-
Object ob = newJsonMapper()
371-
.enable(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
372-
.readValue("[\"ENUM_A\"]", TestEnumFromString.class);
371+
Object ob = MAPPER
372+
.readerFor(TestEnumFromString.class)
373+
.with(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
374+
.readValue("[\"ENUM_A\"]");
373375
assertEquals(TestEnumFromString.class, ob.getClass());
374376
assertSame(TestEnumFromString.ENUM_A, ob);
375377
}

src/test/java/com/fasterxml/jackson/databind/deser/creators/TestCreators3.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ public void testDeserializationFromString() throws Exception {
207207
}
208208

209209
public void testDeserializationFromWrappedString() throws Exception {
210-
assertEquals("DELEG:testProduct",
211-
newJsonMapper()
212-
.enable(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
213-
.readValue("[\"testProduct\"]", Product1853.class).getName());
210+
Product1853 result = MAPPER.readerFor(Product1853.class)
211+
.with(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)
212+
.readValue("[\"testProduct\"]");
213+
assertEquals("DELEG:testProduct", result.getName());
214214
}
215215
}
216216

0 commit comments

Comments
 (0)