@Test
public void testGetSecureClientAddress() throws IOException {

    ZooKeeperServer zks = new ZooKeeperServer();
    /**
     * case 1: When secure client is not configured getSecureClientAddress
     * should return empty string
     */
    ZooKeeperServerBean serverBean = new ZooKeeperServerBean(zks);
    String result = serverBean.getSecureClientPort();
    assertEquals("", result);
    /**
     * case 2: When secure client is configured getSecureClientAddress
     * should return configured SecureClientAddress
     */
    ServerCnxnFactory cnxnFactory = ServerCnxnFactory.createFactory();
    int secureClientPort = 8443;
    InetSocketAddress address = new InetSocketAddress(secureClientPort);
    cnxnFactory.configure(address, 5, true);
    zks.setSecureServerCnxnFactory(cnxnFactory);
    result = serverBean.getSecureClientAddress();
    String ipv4 = "0.0.0.0:" + secureClientPort;
    String ipv6 = "0:0:0:0:0:0:0:0:" + secureClientPort;
    assertTrue(result.equals(ipv4) || result.equals(ipv6));
    // cleanup
    cnxnFactory.shutdown();
}