From 949c422c4a95bfdcfb07153a8b1590c11fde5800 Mon Sep 17 00:00:00 2001 From: Mukta13 Date: Sat, 12 Oct 2024 12:40:04 -0500 Subject: [PATCH] Fix flaky test --- .../java/com/alibaba/fastjson2/issues_2600/Issue2672.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/com/alibaba/fastjson2/issues_2600/Issue2672.java b/core/src/test/java/com/alibaba/fastjson2/issues_2600/Issue2672.java index 843302d418..d2aa36a50f 100644 --- a/core/src/test/java/com/alibaba/fastjson2/issues_2600/Issue2672.java +++ b/core/src/test/java/com/alibaba/fastjson2/issues_2600/Issue2672.java @@ -5,7 +5,7 @@ import com.alibaba.fastjson2.filter.PropertyPreFilter; import org.junit.jupiter.api.Test; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -13,9 +13,9 @@ public class Issue2672 { @Test public void test() { - Map map = new HashMap<>(); - map.put("k", "v"); + Map map = new LinkedHashMap<>(); map.put("selfRef", map); + map.put("k", "v"); assertEquals("{\"selfRef\":{\"$ref\":\"..\"},\"k\":\"v\"}", JSON.toJSONString(map, JSONWriter.Feature.ReferenceDetection));