You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ch...@apache.org on 2022/12/08 05:40:21 UTC

[dolphinscheduler] branch dev updated: [Improvement] Fixed Possible JSON ordering permutations problem in Tests (#13118)

This is an automated email from the ASF dual-hosted git repository.

chufenggao pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 2b2adecd85 [Improvement] Fixed Possible JSON ordering permutations problem in Tests (#13118)
2b2adecd85 is described below

commit 2b2adecd85792440690aee94ba4eb8e59c931859
Author: Bharati Kulkarni <31...@users.noreply.github.com>
AuthorDate: Wed Dec 7 23:40:08 2022 -0600

    [Improvement] Fixed Possible JSON ordering permutations problem in Tests (#13118)
    
    * Fixed flaky test
    
    * Fixed imports order
---
 .../dolphinscheduler/spi/params/PluginParamsTransferTest.java      | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dolphinscheduler-spi/src/test/java/org/apache/dolphinscheduler/spi/params/PluginParamsTransferTest.java b/dolphinscheduler-spi/src/test/java/org/apache/dolphinscheduler/spi/params/PluginParamsTransferTest.java
index 1f88584a83..72fae3d56d 100644
--- a/dolphinscheduler-spi/src/test/java/org/apache/dolphinscheduler/spi/params/PluginParamsTransferTest.java
+++ b/dolphinscheduler-spi/src/test/java/org/apache/dolphinscheduler/spi/params/PluginParamsTransferTest.java
@@ -32,6 +32,9 @@ import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParser;
+
 /**
  * PluginParamsTransfer Tester.
  */
@@ -178,7 +181,9 @@ public class PluginParamsTransferTest {
                 + ",\"disabled\":false},{\"label\":\"text\",\"value\":\"text\",\"disabled\":false},{\"label\""
                 + ":\"attachment\",\"value\":\"attachment\",\"disabled\":false},{\"label\":\"tableattachment\""
                 + ",\"value\":\"tableattachment\",\"disabled\":false}]}]";
-        Assertions.assertEquals(paramsJsonAssert, paramsJson);
+        JsonElement paramsJsonElement = JsonParser.parseString(paramsJson);
+        JsonElement paramsAssertJsonElement = JsonParser.parseString(paramsJsonAssert);
+        Assertions.assertEquals(paramsAssertJsonElement, paramsJsonElement);
     }
 
     @Test