From e0d521bf82ee8cbcc51416ddc8161fa559a28601 Mon Sep 17 00:00:00 2001 From: mumbler6 Date: Wed, 16 Oct 2024 19:15:39 -0500 Subject: [PATCH] fixed flaky test in testDisabledModule() --- .../DefaultJsonJacksonProviderForBothModulesTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/media/json-jackson/src/test/java/org/glassfish/jersey/jackson/internal/DefaultJsonJacksonProviderForBothModulesTest.java b/media/json-jackson/src/test/java/org/glassfish/jersey/jackson/internal/DefaultJsonJacksonProviderForBothModulesTest.java index 9d86b842b2..4eb4886063 100644 --- a/media/json-jackson/src/test/java/org/glassfish/jersey/jackson/internal/DefaultJsonJacksonProviderForBothModulesTest.java +++ b/media/json-jackson/src/test/java/org/glassfish/jersey/jackson/internal/DefaultJsonJacksonProviderForBothModulesTest.java @@ -23,6 +23,9 @@ import javax.ws.rs.core.Application; +import java.util.List; +import java.util.Arrays; +import java.util.Collections; import static org.junit.jupiter.api.Assertions.assertEquals; public class DefaultJsonJacksonProviderForBothModulesTest extends JerseyTest { @@ -36,8 +39,12 @@ protected final Application configure() { public final void testDisabledModule() { final String response = target("entity/simple") .request().get(String.class); + String expected = "{\"name\":\"Hello\",\"value\":\"World\"}"; + List response_list = Arrays.asList(response.replaceAll("[{}]", "").split(",")); + List expected_list = Arrays.asList(expected.replaceAll("[{}]", "").split(",")); + Collections.sort(response_list); - assertEquals("{\"name\":\"Hello\",\"value\":\"World\"}", response); + assertEquals(expected_list, response_list); } }