From c193d4deb5b7a1987e5e9531ff2c20d83e7c970b Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 3 Oct 2017 10:42:36 +0200 Subject: [PATCH] Fix instability of ClusterHealthTest#hashcode_is_based_on_content() Two different objects can have the same hashCode. --- .../test/java/org/sonar/server/health/ClusterHealthTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/sonar-server/src/test/java/org/sonar/server/health/ClusterHealthTest.java b/server/sonar-server/src/test/java/org/sonar/server/health/ClusterHealthTest.java index 99ed8271692..72af5de0636 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/health/ClusterHealthTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/health/ClusterHealthTest.java @@ -87,9 +87,7 @@ public class ClusterHealthTest { Set 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 -- 2.39.5