RegistryClients { public static RegistryClient createZookeeperClient(Config config) throws IOException { CuratorFramework client = CuratorFrameworkFactory.builder() .connectString(getZookeeperConnectionString(config)) .retryPolicy(new RetryOneTime(1000)) .build(); client.start(); return new ZookeeperRegistryClient(client, new ObjectMapper(), config); } private  RegistryClients(); static RegistryClient createZookeeperClient(Config config);  }
@Test public void testCreateZookeeperClient() throws Exception { MockitoAnnotations.initMocks(this); testingServer = new TestingServer(); when(config.getList(eq(REGISTRY_ZOOKEEPER_SERVERS))) .thenReturn(Arrays.asList(testingServer.getConnectString())); RegistryClient registryClient = RegistryClients.createZookeeperClient(config); assertNotNull(registryClient); assertEquals(registryClient.getEntries().size(), 0); }