Skip to content

Commit 62fe94e

Browse files
author
xinying7
committed
fix flaky test serializeObjectPropertyWithRequiredProperties
1 parent b48706f commit 62fe94e

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
@@ -327,8 +327,11 @@ public void serializeObjectPropertyWithRequiredProperties() throws IOException {
327327
final Schema p = new ObjectSchema()
328328
.addProperties("stringProperty", new StringSchema());
329329
p.required(Arrays.asList("stringProperty"));
330-
final String json = "{\"required\":[\"stringProperty\"],\"type\":\"object\",\"properties\":{\"stringProperty\":{\"type\":\"string\"}}}";
331-
assertEquals(m.writeValueAsString(p), json);
330+
final String json1 = "{\"required\":[\"stringProperty\"],\"type\":\"object\",\"properties\":{\"stringProperty\":{\"type\":\"string\"}}}";
331+
String json2 = m.writeValueAsString(p);
332+
JSONObject jsonObj1 = new JSONObject(json1);
333+
JSONObject jsonObj2 = new JSONObject(json2);
334+
JSONAssert.assertEquals(jsonObj1, jsonObj2, true);
332335
}
333336

334337
@Test(description = "it should deserialize an object property with required set")

0 commit comments

Comments
 (0)