Skip to content

Commit db942fc

Browse files
author
xinying7
committed
fix flaky test deserializeLongMapProperty
1 parent e331e25 commit db942fc

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
@@ -211,11 +211,14 @@ public void serializeLongMapProperty() throws IOException {
211211

212212
@Test(description = "it should deserialize a long MapProperty")
213213
public void deserializeLongMapProperty() throws IOException {
214-
final String json = "{\"type\":\"object\",\"additionalProperties\":{\"type\":\"integer\",\"format\":\"int64\"}}";
215-
final Schema p = m.readValue(json, Schema.class);
214+
final String json1 = "{\"type\":\"object\",\"additionalProperties\":{\"type\":\"integer\",\"format\":\"int64\"}}";
215+
final Schema p = m.readValue(json1, Schema.class);
216216
assertEquals(p.getType(), "object");
217217
assertEquals(p.getClass(), MapSchema.class);
218-
assertEquals(m.writeValueAsString(p), json);
218+
String json2 = m.writeValueAsString(p);
219+
JSONObject jsonObj1 = new JSONObject(json1);
220+
JSONObject jsonObj2 = new JSONObject(json2);
221+
JSONAssert.assertEquals(jsonObj1, jsonObj2, true);
219222
}
220223

221224
@Test(description = "it should serialize a RefProperty")

0 commit comments

Comments
 (0)