NacosDynamicConfiguration implements DynamicConfiguration { @Override public boolean publishConfig(String key, String group, String content) { boolean published = false; String resolvedGroup = resolveGroup(group); try { published = configService.publishConfig(key, resolvedGroup, content); } catch (NacosException e) { logger.error(e.getErrMsg(), e); } return published; } NacosDynamicConfiguration(URL url); @Override void addListener(String key, String group, ConfigurationListener listener); @Override void removeListener(String key, String group, ConfigurationListener listener); @Override String getConfig(String key, String group, long timeout); @Override Object getInternalProperty(String key); @Override boolean publishConfig(String key, String group, String content); @Override long getDefaultTimeout(); @Override SortedSet<String> getConfigKeys(String group); @Override boolean removeConfig(String key, String group);  }
@Test public void testPublishConfig() { String key = "user-service"; String group = "org.apache.dubbo.service.UserService"; String content = "test"; assertTrue(config.publishConfig(key, group, content)); assertEquals("test", config.getProperties(key, group)); }