Skip to content

Commit

Permalink
fixed flaky test in testDisabledModule()
Browse files Browse the repository at this point in the history
  • Loading branch information
mumbler6 committed Oct 17, 2024
1 parent ff5f5a8 commit e0d521b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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<String> response_list = Arrays.asList(response.replaceAll("[{}]", "").split(","));
List<String> expected_list = Arrays.asList(expected.replaceAll("[{}]", "").split(","));
Collections.sort(response_list);

assertEquals("{\"name\":\"Hello\",\"value\":\"World\"}", response);
assertEquals(expected_list, response_list);
}

}

0 comments on commit e0d521b

Please sign in to comment.