Skip to content

Commit a27e145

Browse files
committed
Merge branch '2.1.x' into 2.2.x
Closes gh-20432
2 parents 1fdb083 + 06d870b commit a27e145

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/cloud/CloudFoundryVcapEnvironmentPostProcessor.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
*
8888
* @author Dave Syer
8989
* @author Andy Wilkinson
90-
* @author Madhura Bhave
9190
* @since 1.3.0
9291
*/
9392
public class CloudFoundryVcapEnvironmentPostProcessor
@@ -231,19 +230,7 @@ private String getPropertyName(String path, String key) {
231230
if (key.startsWith("[")) {
232231
return path + key;
233232
}
234-
if (shouldWrap(key)) {
235-
return path + "[" + key + "]";
236-
}
237233
return path + "." + key;
238234
}
239235

240-
private boolean shouldWrap(String key) {
241-
for (char ch : key.toCharArray()) {
242-
if (!Character.isLowerCase(ch) && !Character.isDigit(ch) && ch != '-') {
243-
return true;
244-
}
245-
}
246-
return false;
247-
}
248-
249236
}

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/cloud/cloudfoundry/CloudFoundryVcapEnvironmentPostProcessorTests.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
*
3131
* @author Dave Syer
3232
* @author Andy Wilkinson
33-
* @author Hans Schulz
34-
* @author Madhura Bhave
3533
*/
3634
class CloudFoundryVcapEnvironmentPostProcessorTests {
3735

@@ -118,26 +116,6 @@ void testServicePropertiesWithoutNA() {
118116
assertThat(getProperty("vcap.services.mysql.credentials.port")).isEqualTo("3306");
119117
}
120118

121-
@Test
122-
void testServicePropertiesContainingKeysWithDot() {
123-
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.context,
124-
"VCAP_SERVICES={\"user-provided\":[{\"name\":\"test\",\"label\":\"test-label\","
125-
+ "\"credentials\":{\"key.with.dots\":\"some-value\"}}]}");
126-
this.initializer.postProcessEnvironment(this.context.getEnvironment(), null);
127-
assertThat(getProperty("vcap.services.test.name")).isEqualTo("test");
128-
assertThat(getProperty("vcap.services.test.credentials[key.with.dots]")).isEqualTo("some-value");
129-
}
130-
131-
@Test
132-
void testServicePropertiesContainingKeysWithUpperCaseAndNonAlphaNumericCharacters() {
133-
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.context,
134-
"VCAP_SERVICES={\"user-provided\":[{\"name\":\"test\",\"label\":\"test-label\","
135-
+ "\"credentials\":{\"My-Key\":\"some-value\", \"foo@\":\"bar\"}}]}");
136-
this.initializer.postProcessEnvironment(this.context.getEnvironment(), null);
137-
assertThat(getProperty("vcap.services.test.credentials[My-Key]")).isEqualTo("some-value");
138-
assertThat(getProperty("vcap.services.test.credentials[foo@]")).isEqualTo("bar");
139-
}
140-
141119
private String getProperty(String key) {
142120
return this.context.getEnvironment().getProperty(key);
143121
}

0 commit comments

Comments
 (0)