fix publish null value when use consul config center (#6351)

* fix publish null value when use consul config center
This commit is contained in:
tswstarplanet 2020-06-21 00:12:40 +08:00 committed by GitHub
parent 1e51703f8f
commit 5230444d5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -145,7 +145,7 @@ public class ConsulDynamicConfiguration implements DynamicConfiguration {
// }
// return true;
String normalizedKey = convertKey(group, key);
return kvClient.putValue(normalizedKey + PATH_SEPARATOR + content);
return kvClient.putValue(normalizedKey, content);
}
@Override

View File

@ -102,6 +102,12 @@ public class ConsulDynamicConfigurationTest {
System.out.println(kvClient.getValues("/dubbo/config/dubbo/foo"));
}
@Test
public void testPublishConfig() {
configuration.publishConfig("foo", "value1");
Assertions.assertEquals("value1", configuration.getString("/dubbo/config/dubbo/foo"));
}
@Test
public void testGetConfigKeys() {