@Test
    public void testNotifyListener() {
        ConsumerConfig<Object> consumerConfig = new ConsumerConfig<>();
        String directUrl1 = "bolt://alipay.com";
        String directUrl2 = "bolt://taobao.com";
        String directUrl = directUrl1 + ";" + directUrl2;
        consumerConfig.setDirectUrl(directUrl);
        MockProviderInfoListener mockProviderInfoListener = new MockProviderInfoListener();
        consumerConfig.setProviderInfoListener(mockProviderInfoListener);


        domainRegistry.subscribe(consumerConfig);

        assertTrue(domainRegistry.notifyListeners.containsKey(directUrl));
        domainRegistry.refreshDomain();

        assertTrue(domainRegistry.domainCache.containsKey(directUrl1));
        assertTrue(domainRegistry.domainCache.containsKey(directUrl2));

        domainRegistry.notifyListener();

        Map<String, List<ProviderInfo>> data = mockProviderInfoListener.getData();
        assertEquals(1, data.size());
        assertTrue(data.containsKey(RpcConstants.ADDRESS_DIRECT_GROUP));
        List<ProviderInfo> providerInfo = data.get(RpcConstants.ADDRESS_DIRECT_GROUP);
        assertTrue(providerInfo.size() > 1);
    }
@author <a href=mailto:orezsilence@163.com>zhangchengxi</a>
registry/registry-local/src/test/java/com/alipay/sofa/rpc/registry/local/DomainRegistryTest.java