Skip to content

Commit bc3fa15

Browse files
author
xinying7
committed
fixed flaky test deserializeIntegerProperty
1 parent db942fc commit bc3fa15

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
@@ -140,12 +140,15 @@ public void serializeIntegerProperty() throws IOException {
140140

141141
@Test(description = "it should deserialize a IntegerProperty")
142142
public void deserializeIntegerProperty() throws IOException {
143-
final String json = "{\"type\":\"integer\",\"format\":\"int32\"}";
144-
final Schema p = m.readValue(json, Schema.class);
143+
final String json1 = "{\"type\":\"integer\",\"format\":\"int32\"}";
144+
final Schema p = m.readValue(json1, Schema.class);
145145
assertEquals(p.getType(), "integer");
146146
assertEquals(p.getFormat(), "int32");
147147
assertEquals(p.getClass(), IntegerSchema.class);
148-
assertEquals(m.writeValueAsString(p), json);
148+
String json2 = m.writeValueAsString(p);
149+
JSONObject jsonObj1 = new JSONObject(json1);
150+
JSONObject jsonObj2 = new JSONObject(json2);
151+
JSONAssert.assertEquals(jsonObj1, jsonObj2, true);
149152
}
150153

151154
@Test(description = "it should serialize a LongProperty")

0 commit comments

Comments
 (0)