Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import org.apache.pulsar.common.schema.KeyValueEncodingType;
import org.apache.pulsar.common.schema.SchemaInfo;
import org.apache.pulsar.common.schema.SchemaType;
import org.json.JSONException;
import org.skyscreamer.jsonassert.JSONAssert;
import org.skyscreamer.jsonassert.JSONCompareMode;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -289,8 +292,8 @@ public static Object[][] schemas() {
}

@Test(dataProvider = "schemas")
public void testSchemaInfoToString(SchemaInfo si, String jsonifiedStr) {
assertEquals(si.toString(), jsonifiedStr);
public void testSchemaInfoToString(SchemaInfo si, String jsonifiedStr) throws JSONException {
JSONAssert.assertEquals(si.toString(), jsonifiedStr, JSONCompareMode.NON_EXTENSIBLE);
}

public static class SchemaInfoBuilderTest {
Expand Down Expand Up @@ -327,7 +330,7 @@ public void testSetProperties() {
}

@Test
public void testNullPropertyValue() {
public void testNullPropertyValue() throws JSONException {
final Map<String, String> map = new HashMap<>();
map.put("key", null);

Expand All @@ -339,7 +342,7 @@ public void testNullPropertyValue() {
.build();

// null key will be skipped by Gson when serializing JSON to String
assertEquals(si.toString(), INT32_SCHEMA_INFO);
JSONAssert.assertEquals(si.toString(), INT32_SCHEMA_INFO, JSONCompareMode.NON_EXTENSIBLE);
}
}
}
Loading