diff --git a/spring-boot/src/main/java/org/springframework/boot/cloudfoundry/VcapApplicationListener.java b/spring-boot/src/main/java/org/springframework/boot/cloudfoundry/VcapApplicationListener.java index 116d5f54cf9..58fc2b0844e 100644 --- a/spring-boot/src/main/java/org/springframework/boot/cloudfoundry/VcapApplicationListener.java +++ b/spring-boot/src/main/java/org/springframework/boot/cloudfoundry/VcapApplicationListener.java @@ -211,6 +211,9 @@ public class VcapApplicationListener implements else if (value instanceof Number) { properties.put(key, value.toString()); } + else if (value instanceof Boolean) { + properties.put(key, value.toString()); + } else if (value instanceof Map) { // Need a compound key @SuppressWarnings("unchecked") diff --git a/spring-boot/src/test/java/org/springframework/boot/cloudfoundry/VcapApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/cloudfoundry/VcapApplicationListenerTests.java index 6e1e9986d24..74b9a75c2f5 100644 --- a/spring-boot/src/test/java/org/springframework/boot/cloudfoundry/VcapApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/cloudfoundry/VcapApplicationListenerTests.java @@ -111,12 +111,15 @@ public class VcapApplicationListenerTests { + "\"plan\":\"10mb\",\"credentials\":{" + "\"name\":\"d04fb13d27d964c62b267bbba1cffb9da\"," + "\"hostname\":\"mysql-service-public.clqg2e2w3ecf.us-east-1.rds.amazonaws.com\"," + + "\"ssl\":true,\"location\":null," + "\"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", getProperty("vcap.services.mysql.name")); assertEquals("3306", getProperty("vcap.services.mysql.credentials.port")); + assertEquals("true", getProperty("vcap.services.mysql.credentials.ssl")); + assertEquals("", getProperty("vcap.services.mysql.credentials.location")); } @Test