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

wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git


The following commit(s) were added to refs/heads/main by this push:
     new 9a62d72e09 Fix flaky test caused by .toArray() (#403)
9a62d72e09 is described below

commit 9a62d72e090a6e69ada18ec498aff71eb13d922b
Author: Bharati Kulkarni <[email protected]>
AuthorDate: Mon Dec 5 20:23:04 2022 -0600

    Fix flaky test caused by .toArray() (#403)
---
 .../java/org/apache/skywalking/apm/util/ConfigInitializerTest.java   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/apm-commons/apm-util/src/test/java/org/apache/skywalking/apm/util/ConfigInitializerTest.java
 
b/apm-commons/apm-util/src/test/java/org/apache/skywalking/apm/util/ConfigInitializerTest.java
index 53c5a78082..44420e4067 100644
--- 
a/apm-commons/apm-util/src/test/java/org/apache/skywalking/apm/util/ConfigInitializerTest.java
+++ 
b/apm-commons/apm-util/src/test/java/org/apache/skywalking/apm/util/ConfigInitializerTest.java
@@ -21,6 +21,7 @@ package org.apache.skywalking.apm.util;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.internal.util.collections.Sets;
 
 import java.util.Arrays;
 import java.util.HashMap;
@@ -67,8 +68,8 @@ public class ConfigInitializerTest {
         Assert.assertArrayEquals(new Integer[]{1, 2, 3, 4}, 
TestPropertiesObject.Level1Object.LIST_INT_ATTR_ED2.toArray());
         Assert.assertArrayEquals(new String[]{}, 
TestPropertiesObject.Level1Object.SET_STR_EMPTY_ATTR.toArray());
         Assert.assertArrayEquals(new Boolean[]{true, false}, 
TestPropertiesObject.Level1Object.LIST_BOOL_ATTR.toArray());
-        Assert.assertArrayEquals(new String[]{"a", "b", "c", "d"}, 
TestPropertiesObject.Level1Object.SET_STR_ATTR.toArray());
-        Assert.assertArrayEquals(new Integer[]{1, 2, 3, 4}, 
TestPropertiesObject.Level1Object.SET_INT_ATTR.toArray());
+        Assert.assertEquals(Sets.newSet("a", "b", "c", "d"), 
TestPropertiesObject.Level1Object.SET_STR_ATTR);
+        Assert.assertEquals(Sets.newSet(1, 2, 3, 4), 
TestPropertiesObject.Level1Object.SET_INT_ATTR);
         Assert.assertArrayEquals(new Boolean[]{true}, 
TestPropertiesObject.Level1Object.SET_BOOL_ATTR.toArray());
         Assert.assertEquals(TestColorEnum.RED, 
TestPropertiesObject.Level1Object.Level2Object.ENUM_ATTR);
         //make sure that when descs is empty,toString() work right;

Reply via email to