Skip to content

Commit 131a405

Browse files
committed
further unit test improvements
1 parent 2520c29 commit 131a405

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/java/com/fasterxml/jackson/databind/jsontype/PolymorphicViaRefTypeTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ public void testPolymorphicAtomicRefProperty() throws Exception
5353
String json = MAPPER.writeValueAsString(data);
5454
TypeInfoAtomic result = MAPPER.readValue(json, TypeInfoAtomic.class);
5555
assertNotNull(result);
56+
BaseForAtomic value = result.value.get();
57+
assertNotNull(value);
58+
assertEquals(ImplForAtomic.class, value.getClass());
59+
assertEquals(42, ((ImplForAtomic) value).x);
5660
}
5761

5862
public void testAtomicRefViaDefaultTyping() throws Exception
@@ -63,5 +67,9 @@ public void testAtomicRefViaDefaultTyping() throws Exception
6367
String json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(data);
6468
AtomicStringWrapper result = mapper.readValue(json, AtomicStringWrapper.class);
6569
assertNotNull(result);
70+
assertNotNull(result.wrapper);
71+
assertEquals(AtomicReference.class, result.wrapper.getClass());
72+
StringWrapper w = result.wrapper.get();
73+
assertEquals("foo", w.str);
6674
}
6775
}

0 commit comments

Comments
 (0)