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 {
47
47
static class MyStuff594 {
48
48
public Map <MyEnum594 ,String > stuff = new EnumMap <MyEnum594 ,String >(MyEnum594 .class );
49
49
50
+ protected MyStuff594 () { }
50
51
public MyStuff594 (String value ) {
51
52
stuff .put (MyEnum594 .VALUE_WITH_A_REALLY_LONG_NAME_HERE , value );
52
53
}
@@ -136,8 +137,11 @@ public void testCustomEnumMapKeySerializer() throws Exception {
136
137
// [databind#594]
137
138
@ Test
138
139
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 ));
141
145
}
142
146
143
147
// [databind#2129]
You can’t perform that action at this time.
0 commit comments