Skip to content

Commit 7108f58

Browse files
committed
Merge branch '2.5'
Conflicts: src/test/java/com/fasterxml/jackson/databind/ser/TestMapSerialization.java
2 parents 474c010 + 14d979d commit 7108f58

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import java.util.concurrent.ConcurrentHashMap;
66

77
import com.fasterxml.jackson.annotation.*;
8-
98
import com.fasterxml.jackson.core.*;
109

1110
import com.fasterxml.jackson.databind.*;
@@ -137,6 +136,11 @@ public String toString() {
137136

138137
static class WatMap extends HashMap<Wat,Boolean> { }
139138

139+
// for [databind#691]
140+
@JsonTypeInfo(use=JsonTypeInfo.Id.NAME)
141+
@JsonTypeName("mymap")
142+
static class MapWithTypedValues extends LinkedHashMap<String,String> { }
143+
140144
/*
141145
/**********************************************************
142146
/* Test methods
@@ -287,5 +291,18 @@ public void testClassKey() throws IOException
287291
String json = MAPPER.writeValueAsString(map);
288292
assertEquals(aposToQuotes("{'java.lang.String':2}"), json);
289293
}
294+
295+
// [databind#691]
296+
public void testNullJsonMapping691() throws Exception
297+
{
298+
MapWithTypedValues input = new MapWithTypedValues();
299+
input.put("id", "Test");
300+
input.put("NULL", null);
301+
302+
String json = MAPPER.writeValueAsString(input);
303+
304+
assertEquals(aposToQuotes("{'@type':'mymap','id':'Test','NULL':null}"),
305+
json);
306+
}
290307
}
291308

0 commit comments

Comments
 (0)