From 4009fe3a05caaf45ec230fbedc29dbe5d9b7f412 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Tue, 27 Jun 2017 10:33:01 -0700 Subject: [PATCH] Add failing test for #1679 --- .../failing/KeySerializers1679Test.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/test/java/com/fasterxml/jackson/failing/KeySerializers1679Test.java diff --git a/src/test/java/com/fasterxml/jackson/failing/KeySerializers1679Test.java b/src/test/java/com/fasterxml/jackson/failing/KeySerializers1679Test.java new file mode 100644 index 0000000000..095be8595d --- /dev/null +++ b/src/test/java/com/fasterxml/jackson/failing/KeySerializers1679Test.java @@ -0,0 +1,25 @@ +package com.fasterxml.jackson.failing; + +import java.util.*; + +import com.fasterxml.jackson.databind.*; + +public class KeySerializers1679Test extends BaseMapTest +{ + /* + /********************************************************** + /* Unit tests + /********************************************************** + */ + + private final ObjectMapper MAPPER = new ObjectMapper(); + + // [databind#1679] + public void testRecursion1679() throws Exception + { + Map objectMap = new HashMap(); + objectMap.put(new Object(), new Object()); + String json = MAPPER.writeValueAsString(objectMap); + assertEquals("{}", json); + } +}