use of io.r2dbc.spi.ConnectionFactoryOptions in project spring-boot by spring-projects.
the class ConnectionFactoryBuilderTests method optionIsMappedWhenCreatingPoolConfiguration.
@ParameterizedTest
@SuppressWarnings({ "rawtypes", "unchecked" })
@MethodSource("poolingConnectionProviderOptions")
void optionIsMappedWhenCreatingPoolConfiguration(Option option) {
String url = "r2dbc:pool:h2:mem:///" + UUID.randomUUID();
ExpectedOption expectedOption = ExpectedOption.get(option);
ConnectionFactoryOptions options = ConnectionFactoryBuilder.withUrl(url).configure((builder) -> builder.option(PoolingConnectionFactoryProvider.POOL_NAME, "defaultName").option(option, expectedOption.value)).buildOptions();
ConnectionPoolConfiguration configuration = new PoolingAwareOptionsCapableWrapper().connectionPoolConfiguration(options, mock(ConnectionFactory.class));
assertThat(configuration).extracting(expectedOption.property).isEqualTo(expectedOption.value);
}
Aggregations