Merge branch '3.1.x'

This commit is contained in:
Ryan Baxter
2023-03-08 14:29:00 -05:00
2 changed files with 28 additions and 3 deletions

View File

@@ -182,6 +182,19 @@ class EnvironmentControllerTests {
assertThat(yaml).isEqualTo("a:\n b:\n - c\n - d\n");
}
@Test
public void yamlWithBrackets() throws Exception {
Map<String, Object> map = new LinkedHashMap<String, Object>();
map.put("a.test", "e");
map.put("a.b[hello]", "c");
map.put("a.b[world]", "d");
map.put("a.b[world]d", "f");
this.environment.add(new PropertySource("one", map));
when(this.repository.findOne("foo", "bar", null, false)).thenReturn(this.environment);
String yaml = this.controller.yaml("foo", "bar", false).getBody();
assertThat(yaml).isEqualTo("a:\n test: e\n b[hello]: c\n b[world]: d\n b[world]d: f\n");
}
@Test
public void arrayOverridenInEnvironment() throws Exception {
// Add original values first source