]> source.dussan.org Git - sonarqube.git/commitdiff
Fix instability of ClusterHealthTest#hashcode_is_based_on_content()
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 3 Oct 2017 08:42:36 +0000 (10:42 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 3 Oct 2017 10:27:08 +0000 (12:27 +0200)
Two different objects can have the same hashCode.

server/sonar-server/src/test/java/org/sonar/server/health/ClusterHealthTest.java

index 99ed82716924921f74a900cb8cc330704de60be3..72af5de0636616b0f1a46dc905c31cb5b2cd77a4 100644 (file)
@@ -87,9 +87,7 @@ public class ClusterHealthTest {
     Set<NodeHealth> nodeHealths = randomNodeHealths();
     ClusterHealth underTest = new ClusterHealth(health, nodeHealths);
 
-    assertThat(underTest.hashCode())
-      .isEqualTo(underTest.hashCode())
-      .isNotEqualTo(new ClusterHealth(randomHealth(), randomNodeHealths()).hashCode());
+    assertThat(underTest.hashCode()).isEqualTo(underTest.hashCode());
   }
 
   @Test