Skip to content

Commit ee9240c

Browse files
committed
Minor test improvement
1 parent 814ce08 commit ee9240c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/test/java/com/fasterxml/jackson/databind/ser/EnumAsMapKeyTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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]

0 commit comments

Comments
 (0)