Skip to content

Commit c5820d8

Browse files
author
Dave Syer
committed
Ensure new VCAP_SERVICES format works
1 parent dae3822 commit c5820d8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spring-boot/src/test/java/org/springframework/boot/cloudfoundry/VcapApplicationListenerTests.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,15 @@ public void testServiceProperties() {
7575
assertEquals("mysql",
7676
this.context.getEnvironment().getProperty("vcap.services.mysql.name"));
7777
}
78+
79+
@Test
80+
public void testServicePropertiesWithoutNA() {
81+
EnvironmentTestUtils
82+
.addEnvironment(
83+
this.context,
84+
"VCAP_SERVICES:{\"rds-mysql\":[{\"name\":\"mysql\",\"label\":\"rds-mysql\",\"plan\":\"10mb\",\"credentials\":{\"name\":\"d04fb13d27d964c62b267bbba1cffb9da\",\"hostname\":\"mysql-service-public.clqg2e2w3ecf.us-east-1.rds.amazonaws.com\",\"host\":\"mysql-service-public.clqg2e2w3ecf.us-east-1.rds.amazonaws.com\",\"port\":3306,\"user\":\"urpRuqTf8Cpe6\",\"username\":\"urpRuqTf8Cpe6\",\"password\":\"pxLsGVpsC9A5S\"}}]}");
85+
this.initializer.onApplicationEvent(this.event);
86+
assertEquals("mysql",
87+
this.context.getEnvironment().getProperty("vcap.services.mysql.name"));
88+
}
7889
}

0 commit comments

Comments
 (0)