@Test
    public void testUpdateProvider() {
        String groupName = "testUpdateProvider-Group";
        List<ProviderInfo> providerList = Arrays.asList(
                ProviderHelper.toProviderInfo("127.0.0.1:12200"),
                ProviderHelper.toProviderInfo("127.0.0.1:12201"),
                ProviderHelper.toProviderInfo("127.0.0.1:12202"));
        ProviderGroup g = new ProviderGroup(groupName, providerList);
        cluster.updateProviders(g);

        Assert.assertEquals(cluster.currentProviderList().size(), providerList.size());

        cluster.updateProviders(new ProviderGroup(groupName, null));

        Assert.assertTrue(cluster.getAddressHolder().getProviderGroup(groupName).isEmpty());
        Assert.assertEquals( 1, ((TestUseConnectionHolder)cluster.connectionHolder).calledCloseAllClientTransports.get());
    }
@author junyuan
@version ClusterProviderUpdateTest.java, v 0.1 2024-10-11 11:04 junyuan Exp $
core-impl/client/src/test/java/com/alipay/sofa/rpc/client/ClusterProviderUpdateTest.java