@Test
    public void testConfigLoader() throws Exception {

        final HashMap<String, String> map = new HashMap<String, String>();
        map.put("xx", "yy");
        SofaConfigs.ExternalConfigLoader loader = new SofaConfigs.ExternalConfigLoader() {
            @Override
            public String getValue(String key) {
                return map.get(key);
            }

            @Override
            public String getValue(String appName, String key) {
                return map.get(key);
            }
        };

        try {
            SofaConfigs.registerExternalConfigLoader(loader);
            Assert.assertNull(SofaConfigs.getStringValue("zzzz", null));
            Assert.assertEquals(SofaConfigs.getStringValue("zzzz", "ddd"), "ddd");
            Assert.assertEquals(SofaConfigs.getStringValue("xx", null), "yy");

            System.setProperty("zzzz", "aaa");
            System.setProperty("xx", "bbbb");

            Assert.assertEquals(SofaConfigs.getStringValue("zzzz", null), "aaa");
            Assert.assertEquals(SofaConfigs.getStringValue("xx", null), "bbbb");
        } finally {
            SofaConfigs.unRegisterExternalConfigLoader(loader);
        }
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
core/common/src/test/java/com/alipay/sofa/rpc/common/SofaConfigsTest.java