File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/test/java/com/fasterxml/jackson/databind/ser Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ static enum MyEnum594 {
4747 static class MyStuff594 {
4848 public Map <MyEnum594 ,String > stuff = new EnumMap <MyEnum594 ,String >(MyEnum594 .class );
4949
50+ protected MyStuff594 () { }
5051 public MyStuff594 (String value ) {
5152 stuff .put (MyEnum594 .VALUE_WITH_A_REALLY_LONG_NAME_HERE , value );
5253 }
@@ -136,8 +137,11 @@ public void testCustomEnumMapKeySerializer() throws Exception {
136137 // [databind#594]
137138 @ Test
138139 public void testJsonValueForEnumMapKey () throws Exception {
139- assertEquals (a2q ("{'stuff':{'longValue':'foo'}}" ),
140- MAPPER .writeValueAsString (new MyStuff594 ("foo" )));
140+ final String JSON = a2q ("{'stuff':{'longValue':'foo'}}" );
141+ assertEquals (JSON , MAPPER .writeValueAsString (new MyStuff594 ("foo" )));
142+ MyStuff594 result = MAPPER .readValue (JSON , MyStuff594 .class );
143+ assertNotNull (result );
144+ assertEquals ("foo" , result .stuff .get (MyEnum594 .VALUE_WITH_A_REALLY_LONG_NAME_HERE ));
141145 }
142146
143147 // [databind#2129]
You can’t perform that action at this time.
0 commit comments