diff --git a/server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java b/server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java index ec93475635419..a019235c99743 100644 --- a/server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java +++ b/server/src/test/java/org/opensearch/cluster/coordination/JoinTaskExecutorTests.java @@ -122,7 +122,7 @@ public void testPreventJoinClusterWithUnsupportedNodeVersions() { expectThrows(IllegalStateException.class, () -> JoinTaskExecutor.ensureMajorVersionBarrier(oldMajor, minNodeVersion)); } - final Version minGoodVersion = maxNodeVersion.major == minNodeVersion.major ? + final Version minGoodVersion = maxNodeVersion.compareMajor(minNodeVersion) == 0 ? // we have to stick with the same major minNodeVersion : maxNodeVersion.minimumCompatibilityVersion(); final Version justGood = randomVersionBetween(random(), minGoodVersion, maxCompatibleVersion(minNodeVersion));