CURATOR-501 remove ZK 3.5 only class from expectedExceptions in test annotation CURATOR-501 master
authorrandgalt <randgalt@apache.org>
Mon, 7 Jan 2019 21:44:23 +0000 (16:44 -0500)
committerrandgalt <randgalt@apache.org>
Mon, 7 Jan 2019 21:44:23 +0000 (16:44 -0500)
curator-framework/src/test/java/org/apache/curator/framework/imps/TestRemoveWatches.java

index f3b4f8d..63d8931 100644 (file)
@@ -449,7 +449,7 @@ public class TestRemoveWatches extends CuratorTestBase
      * be thrown. \r
      * @throws Exception\r
      */\r
-    @Test(expectedExceptions=KeeperException.NoWatcherException.class)\r
+    @Test\r
     public void testRemoveUnregisteredWatcher() throws Exception\r
     {\r
         CuratorFramework client = CuratorFrameworkFactory.builder().\r
@@ -468,7 +468,15 @@ public class TestRemoveWatches extends CuratorTestBase
                 }                \r
             };\r
             \r
-            client.watches().remove(watcher).forPath(path);\r
+            try\r
+            {\r
+                client.watches().remove(watcher).forPath(path);\r
+                Assert.fail("Expected KeeperException.NoWatcherException");\r
+            }\r
+            catch ( KeeperException.NoWatcherException expected )\r
+            {\r
+                // expected\r
+            }\r
         }\r
         finally\r
         {\r