Skip to content

Commit 13d816f

Browse files
author
xinying7
committed
fix flaky test serializeReadOnlyStringProperty
1 parent c869440 commit 13d816f

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
@@ -295,8 +295,11 @@ public void deserializeArrayStringProperty() throws IOException {
295295
@Test(description = "it should serialize a string property with readOnly set")
296296
public void serializeReadOnlyStringProperty() throws IOException {
297297
final Schema p = new StringSchema().readOnly(true);
298-
final String json = "{\"type\":\"string\",\"readOnly\":true}";
299-
assertEquals(m.writeValueAsString(p), json);
298+
final String json1 = "{\"type\":\"string\",\"readOnly\":true}";
299+
String json2 = m.writeValueAsString(p);
300+
JSONObject jsonObj1 = new JSONObject(json1);
301+
JSONObject jsonObj2 = new JSONObject(json2);
302+
JSONAssert.assertEquals(jsonObj1, jsonObj2, true);
300303
}
301304

302305
@Test(description = "it should serialize a string property with readOnly unset")

0 commit comments

Comments
 (0)