diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilder.java index bf6ff65b756..4642747f572 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilder.java @@ -244,6 +244,8 @@ public final class ConnectionFactoryBuilder { .to(builder::maxIdleTime); map.from(options.getValue(PoolingConnectionFactoryProvider.MAX_CREATE_CONNECTION_TIME)).as(this::toDuration) .to(builder::maxCreateConnectionTime); + map.from(options.getValue(PoolingConnectionFactoryProvider.MIN_IDLE)).as(this::toInteger) + .to(builder::minIdle); map.from(options.getValue(PoolingConnectionFactoryProvider.POOL_NAME)).as(this::toString).to(builder::name); map.from(options.getValue(PoolingConnectionFactoryProvider.PRE_RELEASE)).to((function) -> builder .preRelease((Function>) function)); diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilderTests.java index 56638d1e15a..342becab8fe 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/r2dbc/ConnectionFactoryBuilderTests.java @@ -265,7 +265,7 @@ class ConnectionFactoryBuilderTests { MAX_CREATE_CONNECTION_TIME(PoolingConnectionFactoryProvider.MAX_CREATE_CONNECTION_TIME, Duration.ofSeconds(10), "maxCreateConnectionTime"), - MIN_IDLE(PoolingConnectionFactoryProvider.MIN_IDLE, 0, "minIdle"), + MIN_IDLE(PoolingConnectionFactoryProvider.MIN_IDLE, 5, "minIdle"), POOL_NAME(PoolingConnectionFactoryProvider.POOL_NAME, "testPool", "name"),