Skip to content

Commit 7b31c48

Browse files
author
xinying7
committed
fix flaky test testFormatOfBigDecimal
1 parent 8a4a91b commit 7b31c48

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

modules/swagger-core/src/test/java/io/swagger/v3/core/converting/NumericFormatTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ public void testFormatOfBigDecimal() {
7070
final Map<String, Schema> models = ModelConverters.getInstance().readAll(ModelWithoutScientificFields.class);
7171
assertEquals(models.size(), 1);
7272

73-
String json = Json.pretty(models);
73+
String json1 = Json.pretty(models);
7474

75-
assertEquals(normalizeLineEnds(json),
75+
String json2 =
7676
"{\n" +
7777
" \"ModelWithoutScientificFields\" : {\n" +
7878
" \"type\" : \"object\",\n" +
@@ -86,7 +86,11 @@ public void testFormatOfBigDecimal() {
8686
" }\n" +
8787
" }\n" +
8888
" }\n" +
89-
"}");
89+
"}";
90+
JSONObject jsonObj1 = new JSONObject(json1);
91+
JSONObject jsonObj2 = new JSONObject(json2);
92+
93+
JSONAssert.assertEquals(jsonObj1, jsonObj2, true);
9094

9195
}
9296

0 commit comments

Comments
 (0)