You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2025/11/11 14:15:12 UTC
(pulsar) 02/02: [fix][test] Fixed Nondeterministic Ordering in SchemaInfoTest (#24969)
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git
commit de4c613c95be35779f2642dc420f9ebe01ca533a
Author: Lucas Eby <90...@users.noreply.github.com>
AuthorDate: Tue Nov 11 07:40:08 2025 -0600
[fix][test] Fixed Nondeterministic Ordering in SchemaInfoTest (#24969)
(cherry picked from commit 8f357b0e4d20154699dff130f84b69bf2755cf03)
---
.../org/apache/pulsar/client/impl/schema/SchemaInfoTest.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/SchemaInfoTest.java b/pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/SchemaInfoTest.java
index f3a16ba1f90..dab683beb96 100644
--- a/pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/SchemaInfoTest.java
+++ b/pulsar-client/src/test/java/org/apache/pulsar/client/impl/schema/SchemaInfoTest.java
@@ -25,6 +25,9 @@ import org.apache.pulsar.client.api.Schema;
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;
@@ -289,8 +292,8 @@ public class SchemaInfoTest {
}
@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 {
@@ -327,7 +330,7 @@ public class SchemaInfoTest {
}
@Test
- public void testNullPropertyValue() {
+ public void testNullPropertyValue() throws JSONException {
final Map<String, String> map = new HashMap<>();
map.put("key", null);
@@ -339,7 +342,7 @@ public class SchemaInfoTest {
.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);
}
}
}