Skip to content

Commit 47e37bd

Browse files
mumbler6senivam
authored andcommitted
fixed flaky test in testDisabledModule()
1 parent 1b99237 commit 47e37bd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

media/json-jackson/src/test/java/org/glassfish/jersey/jackson/internal/DefaultJsonJacksonProviderForBothModulesTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024 Oracle and/or its affiliates. All rights reserved.
33
*
44
* This program and the accompanying materials are made available under the
55
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -23,6 +23,9 @@
2323

2424
import javax.ws.rs.core.Application;
2525

26+
import java.util.List;
27+
import java.util.Arrays;
28+
import java.util.Collections;
2629
import static org.junit.jupiter.api.Assertions.assertEquals;
2730

2831
public class DefaultJsonJacksonProviderForBothModulesTest extends JerseyTest {
@@ -36,8 +39,12 @@ protected final Application configure() {
3639
public final void testDisabledModule() {
3740
final String response = target("entity/simple")
3841
.request().get(String.class);
42+
String expected = "{\"name\":\"Hello\",\"value\":\"World\"}";
43+
List<String> response_list = Arrays.asList(response.replaceAll("[{}]", "").split(","));
44+
List<String> expected_list = Arrays.asList(expected.replaceAll("[{}]", "").split(","));
45+
Collections.sort(response_list);
3946

40-
assertEquals("{\"name\":\"Hello\",\"value\":\"World\"}", response);
47+
assertEquals(expected_list, response_list);
4148
}
4249

4350
}

0 commit comments

Comments
 (0)