Skip to content

Commit 5a4ff05

Browse files
author
xinying7
committed
fix flaky test serializeArrayStringProperty
1 parent 950b900 commit 5a4ff05

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/swagger-core/src/test/java/io/swagger/v3/core/serialization/properties/PropertySerializationTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,11 @@ public void deserializeEnumIntegerProperty() throws IOException {
279279
@Test(description = "it should serialize a string array property")
280280
public void serializeArrayStringProperty() throws IOException {
281281
final Schema p = new ArraySchema().items(new StringSchema());
282-
final String json = "{\"type\":\"array\",\"items\":{\"type\":\"string\"}}";
283-
assertEquals(m.writeValueAsString(p), json);
282+
final String json1 = "{\"type\":\"array\",\"items\":{\"type\":\"string\"}}";
283+
String json2 = m.writeValueAsString(p);
284+
JSONObject jsonObj1 = new JSONObject(json1);
285+
JSONObject jsonObj2 = new JSONObject(json2);
286+
JSONAssert.assertEquals(jsonObj1, jsonObj2, true);
284287
}
285288

286289
@Test(description = "it should deserialize a string array property")

0 commit comments

Comments
 (0)