@Test
    public void testAll() {
        RegistryConfig config = new RegistryConfig();
        config.setProtocol("xx")
            .setAddress("127.0.0.1")
            .setFile("file")
            .setRegister(true)
            .setSubscribe(true)
            .setTimeout(1234)
            .setBatch(false)
            .setBatchSize(12)
            .setConnectTimeout(1235)
            .setHeartbeatPeriod(22222)
            .setIndex("null")
            .setParameters(Collections.singletonMap("app", "app"))
            .setParameter("token", "xxx")
            .setReconnectPeriod(3333);

        Assert.assertEquals("xx", config.getProtocol());
        Assert.assertEquals("127.0.0.1", config.getAddress());
        Assert.assertEquals("file", config.getFile());

        Assert.assertEquals(true, config.isRegister());
        Assert.assertEquals(true, config.isSubscribe());
        Assert.assertEquals(1234, config.getTimeout());
        Assert.assertEquals(false, config.isBatch());
        Assert.assertEquals(12, config.getBatchSize());
        Assert.assertEquals(1235, config.getConnectTimeout());
        Assert.assertEquals(22222, config.getHeartbeatPeriod());
        Assert.assertEquals("null", config.getIndex());
        Assert.assertEquals(2, config.getParameters().size());
        Assert.assertEquals("xxx", config.getParameter("token"));
        Assert.assertEquals(3333, config.getReconnectPeriod());

        RegistryConfig config1 = new RegistryConfig().setParameters(Collections.singletonMap("app", "app"));
        RegistryConfig config2 = new RegistryConfig().setParameter("app", "app");
        Assert.assertTrue(config1.equals(config2));

        Assert.assertTrue(config.toString().contains("RegistryConfig"));
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
core/api/src/test/java/com/alipay/sofa/rpc/config/RegistryConfigTest.java