diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointAutoConfigurationTests.java index ce52de0ea9..a56ce59345 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointAutoConfigurationTests.java @@ -44,6 +44,7 @@ import org.springframework.boot.actuate.health.NamedContributor; import org.springframework.boot.actuate.health.ReactiveHealthContributorRegistry; import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension; import org.springframework.boot.actuate.health.ReactiveHealthIndicator; +import org.springframework.boot.actuate.health.ReactiveHealthIndicatorRegistry; import org.springframework.boot.actuate.health.Status; import org.springframework.boot.actuate.health.StatusAggregator; import org.springframework.boot.autoconfigure.AutoConfigurations; @@ -294,10 +295,15 @@ class HealthEndpointAutoConfigurationTests { }); } + @Test + void runWhenReactorAvailableCreatesReactiveHealthIndicatorRegistryBean() { + this.contextRunner.run((context) -> assertThat(context).hasSingleBean(ReactiveHealthIndicatorRegistry.class)); + } + @Test // gh-18570 - void runDoesNotFailWithoutReactorOnClasspath() { + void runWhenReactorUnavailableDoesNotCreateReactiveHealthIndicatorRegistryBean() { this.contextRunner.withClassLoader(new FilteredClassLoader(Mono.class.getPackage().getName())) - .run((context) -> assertThat(context).hasNotFailed()); + .run((context) -> assertThat(context).doesNotHaveBean(ReactiveHealthIndicatorRegistry.class)); } @Configuration(proxyBeanMethods = false) diff --git a/src/checkstyle/checkstyle.xml b/src/checkstyle/checkstyle.xml index 809f7de36c..d62504d927 100644 --- a/src/checkstyle/checkstyle.xml +++ b/src/checkstyle/checkstyle.xml @@ -13,7 +13,7 @@ name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck"> + value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|lang|lang3|logging|pool2).*, ^com\.google\.common.*, ^io\.micrometer\.shaded.*, ^org\.flywaydb\.core\.internal.*, ^org\.testcontainers\.shaded.*" />