diff --git a/helix-rest/src/test/java/org/apache/helix/rest/server/TestPerInstanceAccessor.java b/helix-rest/src/test/java/org/apache/helix/rest/server/TestPerInstanceAccessor.java index 35f0712b41..fd085327bc 100644 --- a/helix-rest/src/test/java/org/apache/helix/rest/server/TestPerInstanceAccessor.java +++ b/helix-rest/src/test/java/org/apache/helix/rest/server/TestPerInstanceAccessor.java @@ -325,8 +325,11 @@ public void testGetAllInstances() throws IOException { Set instances = OBJECT_MAPPER.readValue(instancesStr, OBJECT_MAPPER.getTypeFactory().constructCollectionType(Set.class, String.class)); - Assert.assertEquals(instances, _instancesMap.get(CLUSTER_NAME), "Instances from response: " - + instances + " vs instances actually: " + _instancesMap.get(CLUSTER_NAME)); + String errorMessage = "Instances from response: "+ instances + " vs instances actually: " + + _instancesMap.get(CLUSTER_NAME); + Assert.assertEquals(instances.size(), _instancesMap.get(CLUSTER_NAME).size(), errorMessage); + Assert.assertTrue(instances.containsAll(_instancesMap.get(CLUSTER_NAME)), errorMessage); + Assert.assertTrue(_instancesMap.get(CLUSTER_NAME).containsAll(instances), errorMessage); System.out.println("End test :" + TestHelper.getTestMethodName()); }