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

jxue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git


The following commit(s) were added to refs/heads/master by this push:
     new c0fa6dca1 Fix TestClusterAccessor test (#2767)
c0fa6dca1 is described below

commit c0fa6dca1df11f63521bdd0f1ed5c3a5f969c813
Author: Junkai Xue <[email protected]>
AuthorDate: Mon Feb 26 17:45:36 2024 -0800

    Fix TestClusterAccessor test (#2767)
    
    * Fix TestClusterAccessor
    
    * change format
---
 .../java/org/apache/helix/rest/server/TestClusterAccessor.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/helix-rest/src/test/java/org/apache/helix/rest/server/TestClusterAccessor.java
 
b/helix-rest/src/test/java/org/apache/helix/rest/server/TestClusterAccessor.java
index d10ef9781..e882cf0ce 100644
--- 
a/helix-rest/src/test/java/org/apache/helix/rest/server/TestClusterAccessor.java
+++ 
b/helix-rest/src/test/java/org/apache/helix/rest/server/TestClusterAccessor.java
@@ -99,7 +99,7 @@ public class TestClusterAccessor extends AbstractTestClass {
 
     Set<String> clusters = OBJECT_MAPPER.readValue(clustersStr,
         OBJECT_MAPPER.getTypeFactory().constructCollectionType(Set.class, 
String.class));
-    Assert.assertEquals(clusters, _clusters);
+    Assert.assertTrue(isSame(clusters, _clusters));
 
     validateAuditLogSize(1);
     AuditLog auditLog = _auditLogger.getAuditLogs().get(0);
@@ -1528,6 +1528,11 @@ public class TestClusterAccessor extends 
AbstractTestClass {
         Response.Status.OK.getStatusCode(), null);
   }
 
+  private boolean isSame(Set<String> result, Set<String> expected) {
+    return result.size() == expected.size() && result.containsAll(expected) && 
expected.containsAll(
+        result);
+  }
+
   private void validateAuditLogSize(int expected) {
     Assert.assertEquals(_auditLogger.getAuditLogs().size(), expected,
         "AuditLog:" + _auditLogger.getAuditLogs().toString());

Reply via email to