2525import org .apache .pulsar .common .schema .KeyValueEncodingType ;
2626import org .apache .pulsar .common .schema .SchemaInfo ;
2727import org .apache .pulsar .common .schema .SchemaType ;
28+ import org .json .JSONException ;
29+ import org .skyscreamer .jsonassert .JSONAssert ;
30+ import org .skyscreamer .jsonassert .JSONCompareMode ;
2831import org .testng .annotations .DataProvider ;
2932import org .testng .annotations .Test ;
3033
@@ -289,8 +292,8 @@ public static Object[][] schemas() {
289292 }
290293
291294 @ Test (dataProvider = "schemas" )
292- public void testSchemaInfoToString (SchemaInfo si , String jsonifiedStr ) {
293- assertEquals (si .toString (), jsonifiedStr );
295+ public void testSchemaInfoToString (SchemaInfo si , String jsonifiedStr ) throws JSONException {
296+ JSONAssert . assertEquals (si .toString (), jsonifiedStr , JSONCompareMode . NON_EXTENSIBLE );
294297 }
295298
296299 public static class SchemaInfoBuilderTest {
@@ -327,7 +330,7 @@ public void testSetProperties() {
327330 }
328331
329332 @ Test
330- public void testNullPropertyValue () {
333+ public void testNullPropertyValue () throws JSONException {
331334 final Map <String , String > map = new HashMap <>();
332335 map .put ("key" , null );
333336
@@ -339,7 +342,7 @@ public void testNullPropertyValue() {
339342 .build ();
340343
341344 // null key will be skipped by Gson when serializing JSON to String
342- assertEquals (si .toString (), INT32_SCHEMA_INFO );
345+ JSONAssert . assertEquals (si .toString (), INT32_SCHEMA_INFO , JSONCompareMode . NON_EXTENSIBLE );
343346 }
344347 }
345348}
0 commit comments