From f38e863fbc14979560addd9dd986668035eec1ce Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 10 Mar 2021 15:03:27 +0100 Subject: [PATCH] Properly subscribe to CloseableConnectionFactory#close Closes gh-25565 --- .../actuate/metrics/r2dbc/ConnectionPoolMetricsTests.java | 2 +- .../r2dbc/ConnectionFactoryHealthIndicatorTests.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/r2dbc/ConnectionPoolMetricsTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/r2dbc/ConnectionPoolMetricsTests.java index e9fd2f0267..9af5ef76ca 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/r2dbc/ConnectionPoolMetricsTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/r2dbc/ConnectionPoolMetricsTests.java @@ -59,7 +59,7 @@ class ConnectionPoolMetricsTests { @AfterEach void close() { if (this.connectionFactory != null) { - this.connectionFactory.close(); + StepVerifier.create(this.connectionFactory.close()).verifyComplete(); } } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicatorTests.java index 1327743f83..d5a743dd97 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicatorTests.java @@ -59,7 +59,7 @@ class ConnectionFactoryHealthIndicatorTests { }).verifyComplete(); } finally { - connectionFactory.close(); + StepVerifier.create(connectionFactory.close()).verifyComplete(); } } @@ -110,7 +110,7 @@ class ConnectionFactoryHealthIndicatorTests { }).verifyComplete(); } finally { - connectionFactory.close(); + StepVerifier.create(connectionFactory.close()).verifyComplete(); } } @@ -130,7 +130,7 @@ class ConnectionFactoryHealthIndicatorTests { }).verifyComplete(); } finally { - connectionFactory.close(); + StepVerifier.create(connectionFactory.close()).verifyComplete(); } }