Skip to content

Commit b0df0d6

Browse files
author
xinying7
committed
fix flaky test serializeDateTimeProperty
1 parent 3a8222b commit b0df0d6

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
@@ -68,8 +68,11 @@ public void deserializeDateProperty() throws IOException {
6868
@Test(description = "it should serialize a DateTimeProperty")
6969
public void serializeDateTimeProperty() throws IOException {
7070
final DateTimeSchema p = new DateTimeSchema();
71-
final String json = "{\"type\":\"string\",\"format\":\"date-time\"}";
72-
assertEquals(m.writeValueAsString(p), json);
71+
final String json1 = "{\"type\":\"string\",\"format\":\"date-time\"}";
72+
String json2 = m.writeValueAsString(p);
73+
JSONObject jsonObj1 = new JSONObject(json1);
74+
JSONObject jsonObj2 = new JSONObject(json2);
75+
JSONAssert.assertEquals(jsonObj1, jsonObj2, true);
7376
}
7477

7578
@Test(description = "it should deserialize a DateTimeProperty")

0 commit comments

Comments
 (0)