Open bq-xiao opened 3 years ago
@Test public void testReplacePropertyDefault() throws Exception { String s = ConfigUtils.replaceProperty("1${a.b.c:defaultA}2${a.b.c:defaultB}3", Collections.<String, String>emptyMap()); assertEquals(s, "1defaultA2defaultB3"); }
Pls. provide [GitHub address] to reproduce this issue. https://github.com/apache/dubbo/blob/d98d48914b139d6abb2139ea36e51e536713edfe/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ConfigUtils.java#L186
dubbo.properties 占位符表达式能够支持默认值
What actually happens?
dubbo.properties占位符表达式不支持默认值
上面的单元测试运行失败:
Expected :1:defaultA}2:defaultB}3 Actual :1defaultA2defaultB3
https://github.com/apache/dubbo/blob/d98d48914b139d6abb2139ea36e51e536713edfe/dubbo-common/src/test/java/org/apache/dubbo/common/utils/ConfigUtilsTest.java#L113
Environment
Steps to reproduce this issue
Pls. provide [GitHub address] to reproduce this issue. https://github.com/apache/dubbo/blob/d98d48914b139d6abb2139ea36e51e536713edfe/dubbo-common/src/main/java/org/apache/dubbo/common/utils/ConfigUtils.java#L186
Expected Result
dubbo.properties 占位符表达式能够支持默认值
Actual Result
What actually happens?
dubbo.properties占位符表达式不支持默认值
上面的单元测试运行失败: