Skip to content

Commit 1cbdc2e

Browse files
committed
Adding regression test
(cherry picked from commit 856f15e)
1 parent 542a01a commit 1cbdc2e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/environment/EnvironmentControllerTests.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,20 @@ public void yamlWithBrackets() throws Exception {
195195
assertThat(yaml).isEqualTo("a:\n test: e\n b[hello]: c\n b[world]: d\n b[world]d: f\n");
196196
}
197197

198+
@Test
199+
public void yamlWithBraceInValue() throws Exception {
200+
Map<String, Object> map = new LinkedHashMap<String, Object>();
201+
map.put("a.src", "{cipher}123456");
202+
map.put("b.src", "{string");
203+
map.put("a.dst", "${a.src}");
204+
map.put("b.dst", "${b.src}");
205+
this.environment.add(new PropertySource("one", map));
206+
when(this.repository.findOne("foo", "bar", null, false)).thenReturn(this.environment);
207+
String yaml = this.controller.yaml("foo", "bar", true).getBody();
208+
assertThat(yaml).isEqualTo(
209+
"a:\n src: '{cipher}123456'\n dst: '{cipher}123456'\nb:\n src: '{string'\n dst: '{string'\n");
210+
}
211+
198212
@Test
199213
public void arrayOverridenInEnvironment() throws Exception {
200214
// Add original values first source

0 commit comments

Comments
 (0)