This is an automated email from the ASF dual-hosted git repository.
heliang666s pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.3 by this push:
new 84c4802970 Stabilized the test JsonUtilsTest.consistentTest (#15746)
84c4802970 is described below
commit 84c480297096f19e0b663f2be456bdbd59a76cfe
Author: Anshul Bisht <[email protected]>
AuthorDate: Fri Nov 7 02:18:58 2025 -0600
Stabilized the test JsonUtilsTest.consistentTest (#15746)
Co-authored-by: heliang <[email protected]>
---
.../java/org/apache/dubbo/common/utils/JsonUtilsTest.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git
a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/JsonUtilsTest.java
b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/JsonUtilsTest.java
index 2c491a0877..6fb8721e45 100644
---
a/dubbo-common/src/test/java/org/apache/dubbo/common/utils/JsonUtilsTest.java
+++
b/dubbo-common/src/test/java/org/apache/dubbo/common/utils/JsonUtilsTest.java
@@ -34,6 +34,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
+import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@@ -165,7 +166,8 @@ class JsonUtilsTest {
}
@Test
- void consistentTest() {
+ void consistentTest() throws Exception {
+ ObjectMapper om = new ObjectMapper();
List<Object> objs = new LinkedList<>();
{
@@ -261,11 +263,11 @@ class JsonUtilsTest {
setJson(null);
- Assertions.assertEquals(fromFastjson1, fromFastjson2);
- Assertions.assertEquals(fromFastjson1, fromGson);
- Assertions.assertEquals(fromFastjson2, fromGson);
- Assertions.assertEquals(fromFastjson1, fromJackson);
- Assertions.assertEquals(fromFastjson2, fromJackson);
+ Assertions.assertEquals(om.readTree(fromFastjson1),
om.readTree(fromFastjson2));
+ Assertions.assertEquals(om.readTree(fromFastjson1),
om.readTree(fromGson));
+ Assertions.assertEquals(om.readTree(fromFastjson2),
om.readTree(fromGson));
+ Assertions.assertEquals(om.readTree(fromFastjson1),
om.readTree(fromJackson));
+ Assertions.assertEquals(om.readTree(fromFastjson2),
om.readTree(fromJackson));
}
}