File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
src/test/java/com/fasterxml/jackson/databind/ser/jdk Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 14
14
15
15
public class UUIDSerializationTest extends DatabindTestUtil
16
16
{
17
+ private final static String nullUUIDStr = "00000000-0000-0000-0000-000000000000" ;
18
+ private final static UUID nullUUID = UUID .fromString (nullUUIDStr );
19
+
17
20
static class UUIDWrapperVanilla {
18
21
public UUID uuid ;
19
22
@@ -88,4 +91,18 @@ public void testShapeOverrides() throws Exception
88
91
assertEquals ("{\" uuid\" :\" AAAAAAAAAAAAAAAAAAAAAA==\" }" ,
89
92
m .writeValueAsString (new UUIDWrapperVanilla (nullUUID )));
90
93
}
94
+
95
+ // [databind#5225]: problem with tree conversion
96
+ @ Test
97
+ public void testTreeConversion () throws Exception
98
+ {
99
+ // First, reported issue
100
+ JsonNode node = MAPPER .valueToTree (nullUUID );
101
+ assertEquals (nullUUIDStr , node .asText ());
102
+
103
+ // and then a variations
104
+ Object ob = MAPPER .convertValue (nullUUID , Object .class );
105
+ assertEquals (String .class , ob .getClass ());
106
+ }
107
+
91
108
}
You can’t perform that action at this time.
0 commit comments