Ensure new VCAP_SERVICES format works

pull/590/head
Dave Syer 11 years ago
parent dae38224b7
commit c5820d872a

@ -75,4 +75,15 @@ public class VcapApplicationListenerTests {
assertEquals("mysql", assertEquals("mysql",
this.context.getEnvironment().getProperty("vcap.services.mysql.name")); this.context.getEnvironment().getProperty("vcap.services.mysql.name"));
} }
@Test
public void testServicePropertiesWithoutNA() {
EnvironmentTestUtils
.addEnvironment(
this.context,
"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\"}}]}");
this.initializer.onApplicationEvent(this.event);
assertEquals("mysql",
this.context.getEnvironment().getProperty("vcap.services.mysql.name"));
}
} }

Loading…
Cancel
Save