public void notifyConsumerTest() {
        LocalRegistry registry = new LocalRegistry(new RegistryConfig());
        ConsumerConfig<?> consumer = new ConsumerConfig();
        consumer.setInterfaceId("test");
        LocalRegistryTest.MockProviderInfoListener providerInfoListener = new LocalRegistryTest.MockProviderInfoListener();
        consumer.setProviderInfoListener(providerInfoListener);
        registry.subscribe(consumer);
        String key = LocalRegistryHelper.buildListDataId(consumer, consumer.getProtocol());

        registry.memoryCache.put(key, new ProviderGroup());

        Map<String, ProviderGroup> newCache = new HashMap<String, ProviderGroup>();
        ProviderGroup newProviderGroup = new ProviderGroup();
        ProviderInfo providerInfo = new ProviderInfo().setHost("0.0.0.0");
        newProviderGroup.add(providerInfo);
        newCache.put(key, newProviderGroup);

        registry.notifyConsumer(newCache);

        Map<String, ProviderGroup> ps = providerInfoListener.getData();
        Assert.assertTrue(ps.size() > 0);
        Assert.assertNotNull(ps.get(RpcConstants.ADDRESS_DEFAULT_GROUP));
        Assert.assertTrue(ps.get(RpcConstants.ADDRESS_DEFAULT_GROUP).size() == 1);
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
registry/registry-local/src/test/java/com/alipay/sofa/rpc/registry/local/LocalRegistryTest.java