Skip to content

Commit

Permalink
Upgrade to R2DBC Bom Borca-SR2
Browse files Browse the repository at this point in the history
Closes gh-32328
  • Loading branch information
snicoll committed Sep 14, 2022
1 parent 24ab4e8 commit d4a8804
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Expand Up @@ -93,7 +93,7 @@ void configureWithUrlAndDefaultDoNotOverrideDefaultTimeouts() {
assertThat(context).hasSingleBean(ConnectionFactory.class).hasSingleBean(ConnectionPool.class)
.hasSingleBean(R2dbcProperties.class);
ConnectionPool connectionPool = context.getBean(ConnectionPool.class);
assertThat(connectionPool).hasFieldOrPropertyWithValue("maxAcquireTime", Duration.ofNanos(-1));
assertThat(connectionPool).hasFieldOrPropertyWithValue("maxAcquireTime", Duration.ofMillis(-1));
});
}

Expand Down
2 changes: 1 addition & 1 deletion spring-boot-project/spring-boot-dependencies/build.gradle
Expand Up @@ -1407,7 +1407,7 @@ bom {
]
}
}
library("R2DBC Bom", "Borca-SR1") {
library("R2DBC Bom", "Borca-SR2") {
group("io.r2dbc") {
imports = [
"r2dbc-bom"
Expand Down
Expand Up @@ -244,6 +244,10 @@ ConnectionPoolConfiguration connectionPoolConfiguration(ConnectionFactoryOptions
.to(builder::maxIdleTime);
map.from(options.getValue(PoolingConnectionFactoryProvider.MAX_CREATE_CONNECTION_TIME)).as(this::toDuration)
.to(builder::maxCreateConnectionTime);
map.from(options.getValue(PoolingConnectionFactoryProvider.MAX_VALIDATION_TIME)).as(this::toDuration)
.to(builder::maxValidationTime);
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<? super Connection, ? extends Publisher<Void>>) function));
Expand Down
Expand Up @@ -265,6 +265,11 @@ private enum ExpectedOption {
MAX_CREATE_CONNECTION_TIME(PoolingConnectionFactoryProvider.MAX_CREATE_CONNECTION_TIME, Duration.ofSeconds(10),
"maxCreateConnectionTime"),

MAX_VALIDATION_TIME(PoolingConnectionFactoryProvider.MAX_VALIDATION_TIME, Duration.ofMinutes(4),
"maxValidationTime"),

MIN_IDLE(PoolingConnectionFactoryProvider.MIN_IDLE, 5, "minIdle"),

POOL_NAME(PoolingConnectionFactoryProvider.POOL_NAME, "testPool", "name"),

POST_ALLOCATE(PoolingConnectionFactoryProvider.POST_ALLOCATE, mock(Function.class), "postAllocate"),
Expand Down

0 comments on commit d4a8804

Please sign in to comment.