Aitozi commented on a change in pull request #17053: URL: https://github.com/apache/flink/pull/17053#discussion_r699738100
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/util/ZooKeeperUtilsTest.java ########## @@ -44,4 +58,27 @@ private void runZookeeperPathGenerationTest( assertThat(result, is(expectedValue)); } + + @Test + public void testStartCuratorFrameworkFailed() throws Exception { + try { + final SystemExitTrackingSecurityManager trackingSecurityManager = + new SystemExitTrackingSecurityManager(); + System.setSecurityManager(trackingSecurityManager); + Configuration configuration = new Configuration(); + configuration.setString(HighAvailabilityOptions.HA_ZOOKEEPER_QUORUM, "localhost:2181"); + CuratorZookeeperClient mockedCuratorZookeeperClient = + PowerMockito.mock(CuratorZookeeperClient.class); + PowerMockito.doThrow(new RuntimeException()).when(mockedCuratorZookeeperClient).start(); + PowerMockito.whenNew(CuratorZookeeperClient.class) + .withAnyArguments() + .thenReturn(mockedCuratorZookeeperClient); Review comment: Good point 👍 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org