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 1414
1515public class UUIDSerializationTest extends DatabindTestUtil
1616{
17+ private final static String nullUUIDStr = "00000000-0000-0000-0000-000000000000" ;
18+ private final static UUID nullUUID = UUID .fromString (nullUUIDStr );
19+
1720 static class UUIDWrapperVanilla {
1821 public UUID uuid ;
1922
@@ -88,4 +91,18 @@ public void testShapeOverrides() throws Exception
8891 assertEquals ("{\" uuid\" :\" AAAAAAAAAAAAAAAAAAAAAA==\" }" ,
8992 m .writeValueAsString (new UUIDWrapperVanilla (nullUUID )));
9093 }
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+
91108}
You can’t perform that action at this time.
0 commit comments