diff --git a/curator-test-zk35/src/test/java/org/apache/curator/zk35/TestIs35.java b/curator-test-zk35/src/test/java/org/apache/curator/zk35/TestIs35.java index 9af5368f3..11b8f04a2 100644 --- a/curator-test-zk35/src/test/java/org/apache/curator/zk35/TestIs35.java +++ b/curator-test-zk35/src/test/java/org/apache/curator/zk35/TestIs35.java @@ -23,6 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.apache.curator.test.compatibility.CuratorTestBase; import org.apache.curator.utils.Compatibility; +import org.apache.curator.utils.ZookeeperCompatibility; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -33,6 +34,14 @@ public void testIsZk35() { assertFalse(Compatibility.hasGetReachableOrOneMethod()); assertTrue(Compatibility.hasAddrField()); assertFalse(Compatibility.hasPersistentWatchers()); + assertFalse(ZookeeperCompatibility.LATEST.hasPersistentWatchers()); + assertFalse(ZookeeperCompatibility.builder() + .build() + .hasPersistentWatchers()); + assertFalse(ZookeeperCompatibility.builder() + .hasPersistentWatchers(false) + .build() + .hasPersistentWatchers()); } @Override diff --git a/curator-test-zk36/src/test/java/org/apache/curator/zk36/TestIs36.java b/curator-test-zk36/src/test/java/org/apache/curator/zk36/TestIs36.java index 373160bf7..3bc68e79b 100644 --- a/curator-test-zk36/src/test/java/org/apache/curator/zk36/TestIs36.java +++ b/curator-test-zk36/src/test/java/org/apache/curator/zk36/TestIs36.java @@ -19,10 +19,12 @@ package org.apache.curator.zk36; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; import org.apache.curator.test.compatibility.CuratorTestBase; import org.apache.curator.utils.Compatibility; +import org.apache.curator.utils.ZookeeperCompatibility; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -33,6 +35,14 @@ public void testIsZk36() { assertTrue(Compatibility.hasGetReachableOrOneMethod()); assertTrue(Compatibility.hasAddrField()); assertTrue(Compatibility.hasPersistentWatchers()); + assertTrue(ZookeeperCompatibility.LATEST.hasPersistentWatchers()); + assertFalse(ZookeeperCompatibility.builder() + .build() + .hasPersistentWatchers()); + assertFalse(ZookeeperCompatibility.builder() + .hasPersistentWatchers(false) + .build() + .hasPersistentWatchers()); try { Class.forName("org.apache.zookeeper.proto.WhoAmIResponse"); fail("WhoAmIResponse is introduced after ZooKeeper 3.7");