Skip to content

Commit c96c0b7

Browse files
committed
Add a (passing) unit test for #1535
1 parent 5bd7605 commit c96c0b7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public void testEnumMapSerDisableToString() throws Exception {
412412
m.put(LC749Enum.A, "value");
413413
assertEquals("{\"A\":\"value\"}", w.writeValueAsString(m));
414414
}
415-
415+
416416
public void testEnumMapSerEnableToString() throws Exception {
417417
final ObjectMapper mapper = new ObjectMapper();
418418
ObjectWriter w = mapper.writer().with(SerializationFeature.WRITE_ENUMS_USING_TO_STRING);
@@ -426,6 +426,13 @@ public void testEnumsWithJsonProperty() throws Exception {
426426
assertEquals(quote("aleph"), MAPPER.writeValueAsString(EnumWithJsonProperty.A));
427427
}
428428

429+
// [databind#1535]
430+
public void testEnumKeysWithJsonProperty() throws Exception {
431+
Map<EnumWithJsonProperty,Integer> input = new HashMap<EnumWithJsonProperty,Integer>();
432+
input.put(EnumWithJsonProperty.A, 13);
433+
assertEquals(aposToQuotes("{'aleph':13}"), MAPPER.writeValueAsString(input));
434+
}
435+
429436
// [databind#1322]
430437
public void testEnumsWithJsonPropertyInSet() throws Exception
431438
{

0 commit comments

Comments
 (0)