ZookeeperConfiguration extends AbstractRegistryCenterConfiguration { public boolean isUseNestedZookeeper() { return -1 != nestedPort && !Strings.isNullOrEmpty(nestedDataDir); } ZookeeperConfiguration(final String serverLists, final String namespace);  ZookeeperConfiguration(final String serverLists, final String namespace, final int baseSleepTimeMilliseconds, final int maxSleepTimeMilliseconds, final int maxRetries); boolean isUseNestedZookeeper();  }
@Test public void assertIsNotUseNestedZookeeperWhenPortIsNegative() { ZookeeperConfiguration zkConfig = new ZookeeperConfiguration(); assertFalse(zkConfig.isUseNestedZookeeper()); }
@Test public void assertIsNotUseNestedZookeeperWhenDataDirIsNull() { ZookeeperConfiguration zkConfig = new ZookeeperConfiguration(); zkConfig.setNestedPort(3181); assertFalse(zkConfig.isUseNestedZookeeper()); }
@Test public void assertIsNotUseNestedZookeeperWhenDataDirIsEmpty() { ZookeeperConfiguration zkConfig = new ZookeeperConfiguration(); zkConfig.setNestedPort(3181); zkConfig.setNestedDataDir(""); assertFalse(zkConfig.isUseNestedZookeeper()); }
@Test public void assertIsUseNestedZookeeper() { ZookeeperConfiguration zkConfig = new ZookeeperConfiguration(); zkConfig.setNestedPort(3181); zkConfig.setNestedDataDir("target"); assertTrue(zkConfig.isUseNestedZookeeper()); }