diff --git a/java-cfenv-boot/src/main/java/io/pivotal/cfenv/spring/boot/CfDataSourceEnvironmentPostProcessor.java b/java-cfenv-boot/src/main/java/io/pivotal/cfenv/spring/boot/CfDataSourceEnvironmentPostProcessor.java index 6200a53..250e9d1 100644 --- a/java-cfenv-boot/src/main/java/io/pivotal/cfenv/spring/boot/CfDataSourceEnvironmentPostProcessor.java +++ b/java-cfenv-boot/src/main/java/io/pivotal/cfenv/spring/boot/CfDataSourceEnvironmentPostProcessor.java @@ -15,10 +15,11 @@ */ package io.pivotal.cfenv.spring.boot; +import java.util.Collections; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; import org.springframework.boot.SpringApplication; import org.springframework.boot.cloud.CloudPlatform; @@ -38,6 +39,7 @@ /** * @author Mark Pollack * @author David Turanski + * @author Greg Meyer */ public class CfDataSourceEnvironmentPostProcessor implements CfServiceEnablingEnvironmentPostProcessor, Ordered, ApplicationListener { @@ -72,7 +74,7 @@ public void postProcessEnvironment(ConfigurableEnvironment environment, List jdbcServices = cfJdbcEnv.findJdbcServices().stream() .filter(service -> this.isEnabled(service, environment)) - .collect(Collectors.toList()); + .toList(); if (jdbcServices.size() > 1) { if (invocationCount == 1) { @@ -96,6 +98,36 @@ public void postProcessEnvironment(ConfigurableEnvironment environment, properties.put("spring.datasource.driver-class-name", driverClassName); } + /* R2DBC processing + * Split query param options and URL into two string + * and move options to spring.r2dbc.properties.