fix publish null value when use consul config center (#6351)
* fix publish null value when use consul config center
This commit is contained in:
parent
1e51703f8f
commit
5230444d5f
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue