### Question:
ZookeeperRegisterServiceImpl implements RegistryService<IZkChildListener> { ZkClient buildZkClient(String address, int sessionTimeout, int connectTimeout,String... authInfo) { ZkClient zkClient = new ZkClient(address, sessionTimeout, connectTimeout); if (authInfo != null && authInfo.length == 2) { if (!StringUtils.isBlank(authInfo[0]) && !StringUtils.isBlank(authInfo[1])) { StringBuilder auth = new StringBuilder(authInfo[0]).append(":").append(authInfo[1]); zkClient.addAuthInfo("digest", auth.toString().getBytes()); } } if (!zkClient.exists(ROOT_PATH_WITHOUT_SUFFIX)) { zkClient.createPersistent(ROOT_PATH_WITHOUT_SUFFIX, true); } zkClient.subscribeStateChanges(new IZkStateListener() { @Override public void handleStateChanged(Watcher.Event.KeeperState keeperState) throws Exception { } @Override public void handleNewSession() throws Exception { recover(); } @Override public void handleSessionEstablishmentError(Throwable throwable) throws Exception { } }); return zkClient; } private  ZookeeperRegisterServiceImpl(); @Override void register(InetSocketAddress address); @Override void unregister(InetSocketAddress address); @Override void subscribe(String cluster, IZkChildListener listener); @Override void unsubscribe(String cluster, IZkChildListener listener); @Override List<InetSocketAddress> lookup(String key); @Override void close();  }### Answer:
@Test public void buildZkTest() { ZkClient client = service.buildZkClient("127.0.0.1:2181", 5000, 5000); Assertions.assertTrue(client.exists("/zookeeper")); }