Skip to content

Commit 3a8222b

Browse files
author
xinying7
committed
fix flaky test deserializeArrayStringProperty
1 parent 5a4ff05 commit 3a8222b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,14 @@ public void serializeArrayStringProperty() throws IOException {
288288

289289
@Test(description = "it should deserialize a string array property")
290290
public void deserializeArrayStringProperty() throws IOException {
291-
final String json = "{\"type\":\"array\",\"items\":{\"type\":\"string\"}}";
292-
final Schema p = m.readValue(json, Schema.class);
291+
final String json1 = "{\"type\":\"array\",\"items\":{\"type\":\"string\"}}";
292+
final Schema p = m.readValue(json1, Schema.class);
293+
String json2 = m.writeValueAsString(p);
293294
assertEquals(p.getType(), "array");
294295
assertEquals(p.getClass(), ArraySchema.class);
295-
assertEquals(m.writeValueAsString(p), json);
296+
JSONObject jsonObj1 = new JSONObject(json1);
297+
JSONObject jsonObj2 = new JSONObject(json2);
298+
JSONAssert.assertEquals(jsonObj1, jsonObj2, true);
296299
}
297300

298301
@Test(description = "it should serialize a string property with readOnly set")

0 commit comments

Comments
 (0)