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 d10ef9781f..e882cf0cea 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 void testGetClusters() throws IOException { Set 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 @@ private void updateClusterConfigFromRest(String cluster, ClusterConfig newConfig Response.Status.OK.getStatusCode(), null); } + private boolean isSame(Set result, Set 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());