[Improvement] Fixed Possible JSON ordering permutations problem in Tests (#13118)

* Fixed flaky test

* Fixed imports order
This commit is contained in:
Bharati Kulkarni 2022-12-07 23:40:08 -06:00 committed by GitHub
parent 26b7541d95
commit 2b2adecd85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -32,6 +32,9 @@ import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
/** /**
* PluginParamsTransfer Tester. * PluginParamsTransfer Tester.
*/ */
@ -178,7 +181,9 @@ public class PluginParamsTransferTest {
+ ",\"disabled\":false},{\"label\":\"text\",\"value\":\"text\",\"disabled\":false},{\"label\"" + ",\"disabled\":false},{\"label\":\"text\",\"value\":\"text\",\"disabled\":false},{\"label\""
+ ":\"attachment\",\"value\":\"attachment\",\"disabled\":false},{\"label\":\"tableattachment\"" + ":\"attachment\",\"value\":\"attachment\",\"disabled\":false},{\"label\":\"tableattachment\""
+ ",\"value\":\"tableattachment\",\"disabled\":false}]}]"; + ",\"value\":\"tableattachment\",\"disabled\":false}]}]";
Assertions.assertEquals(paramsJsonAssert, paramsJson); JsonElement paramsJsonElement = JsonParser.parseString(paramsJson);
JsonElement paramsAssertJsonElement = JsonParser.parseString(paramsJsonAssert);
Assertions.assertEquals(paramsAssertJsonElement, paramsJsonElement);
} }
@Test @Test