@Test
public void testFetchAndUpdateZookeeperClientCache() throws Exception {

    int zkServerPort2 = NetUtils.getAvailablePort();
    TestingServer zkServer2 = new TestingServer(zkServerPort2, true);
    int zkServerPort3 = NetUtils.getAvailablePort();
    TestingServer zkServer3 = new TestingServer(zkServerPort3, true);
    URL url = URL.valueOf("zookeeper://127.0.0.1:" + zkServerPort + "/org.apache.dubbo.registry.RegistryService?backup=127.0.0.1:" + zkServerPort3 + ",127.0.0.1:" + zkServerPort2 + "&application=metadatareport-local-xml-provider2&dubbo=2.0.2&interface=org.apache.dubbo.registry.RegistryService&pid=47418&specVersion=2.7.0-SNAPSHOT&timestamp=1547102428828");
    ZookeeperClient newZookeeperClient = abstractZookeeperTransporter.connect(url);
    //just for connected
    newZookeeperClient.getContent("/dubbo/test");
    Assertions.assertEquals(abstractZookeeperTransporter.getZookeeperClientMap().size(), 3);
    Assertions.assertEquals(abstractZookeeperTransporter.getZookeeperClientMap().get("127.0.0.1:" + zkServerPort), newZookeeperClient);
    URL url2 = URL.valueOf("zookeeper://127.0.0.1:" + zkServerPort + "/org.apache.dubbo.metadata.store.MetadataReport?address=zookeeper://127.0.0.1:2181&application=metadatareport-local-xml-provider2&cycle-report=false&interface=org.apache.dubbo.metadata.store.MetadataReport&retry-period=4590&retry-times=23&sync-report=true");
    checkFetchAndUpdateCacheNotNull(url2);
    URL url3 = URL.valueOf("zookeeper://127.0.0.1:8778/org.apache.dubbo.metadata.store.MetadataReport?backup=127.0.0.1:" + zkServerPort3 + "&address=zookeeper://127.0.0.1:2181&application=metadatareport-local-xml-provider2&cycle-report=false&interface=org.apache.dubbo.metadata.store.MetadataReport&retry-period=4590&retry-times=23&sync-report=true");
    checkFetchAndUpdateCacheNotNull(url3);
    zkServer2.stop();
    zkServer3.stop();
}