diff --git a/reactor-netty-core/src/main/java/reactor/netty/resources/ConnectionProvider.java b/reactor-netty-core/src/main/java/reactor/netty/resources/ConnectionProvider.java index 12e7e4c750..a135340403 100644 --- a/reactor-netty-core/src/main/java/reactor/netty/resources/ConnectionProvider.java +++ b/reactor-netty-core/src/main/java/reactor/netty/resources/ConnectionProvider.java @@ -495,12 +495,15 @@ public final Builder forRemoteHost(SocketAddress remoteHost, Consumer argumentCaptor = ArgumentCaptor.forClass(String.class); @@ -636,12 +644,7 @@ void maxConnectionPools(boolean withMaxConnectionPools) throws SSLException { .handle((req, resp) -> resp.sendString(Flux.just("hello ", req.uri()))) .bindNow(); - ConnectionProvider connectionProvider = withMaxConnectionPools ? ConnectionProvider - .builder("max-connection-pools") - .maxConnectionPools(1) - .build() : ConnectionProvider - .builder("max-connection-pools") - .build(); + StepVerifier .create(Flux @@ -674,12 +677,22 @@ void maxConnectionPools(boolean withMaxConnectionPools) throws SSLException { } } finally { - disposableServer.dispose(); + connectionProvider.dispose(); Loggers.resetLoggerFactory(); } } + @ParameterizedTest + @ValueSource(ints = {0, -2}) + void testInvalidMaxConnectionPoolsSetting(int maxConnectionPools) { + + assertThatIllegalArgumentException().isThrownBy(() -> ConnectionProvider + .builder("max-connection-pools") + .maxConnectionPools(maxConnectionPools)); + + } + private SslContext createClientSslContext() { try { return SslContextBuilder.forClient()