File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/test/java/com/fasterxml/jackson/databind/jsontype Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ public void testPolymorphicAtomicRefProperty() throws Exception
53
53
String json = MAPPER .writeValueAsString (data );
54
54
TypeInfoAtomic result = MAPPER .readValue (json , TypeInfoAtomic .class );
55
55
assertNotNull (result );
56
+ BaseForAtomic value = result .value .get ();
57
+ assertNotNull (value );
58
+ assertEquals (ImplForAtomic .class , value .getClass ());
59
+ assertEquals (42 , ((ImplForAtomic ) value ).x );
56
60
}
57
61
58
62
public void testAtomicRefViaDefaultTyping () throws Exception
@@ -63,5 +67,9 @@ public void testAtomicRefViaDefaultTyping() throws Exception
63
67
String json = mapper .writerWithDefaultPrettyPrinter ().writeValueAsString (data );
64
68
AtomicStringWrapper result = mapper .readValue (json , AtomicStringWrapper .class );
65
69
assertNotNull (result );
70
+ assertNotNull (result .wrapper );
71
+ assertEquals (AtomicReference .class , result .wrapper .getClass ());
72
+ StringWrapper w = result .wrapper .get ();
73
+ assertEquals ("foo" , w .str );
66
74
}
67
75
}
You can’t perform that action at this time.
0 commit comments