Commit cf62dc86 authored by Andy Wilkinson's avatar Andy Wilkinson

Polish "Correct Mono import in LegacyHealthEndpointCompatibilityConfiguration"

See gh-18571
parent 35dc4817
...@@ -44,6 +44,7 @@ import org.springframework.boot.actuate.health.NamedContributor; ...@@ -44,6 +44,7 @@ import org.springframework.boot.actuate.health.NamedContributor;
import org.springframework.boot.actuate.health.ReactiveHealthContributorRegistry; import org.springframework.boot.actuate.health.ReactiveHealthContributorRegistry;
import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension; import org.springframework.boot.actuate.health.ReactiveHealthEndpointWebExtension;
import org.springframework.boot.actuate.health.ReactiveHealthIndicator; 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.Status;
import org.springframework.boot.actuate.health.StatusAggregator; import org.springframework.boot.actuate.health.StatusAggregator;
import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.autoconfigure.AutoConfigurations;
...@@ -294,10 +295,15 @@ class HealthEndpointAutoConfigurationTests { ...@@ -294,10 +295,15 @@ class HealthEndpointAutoConfigurationTests {
}); });
} }
@Test
void runWhenReactorAvailableCreatesReactiveHealthIndicatorRegistryBean() {
this.contextRunner.run((context) -> assertThat(context).hasSingleBean(ReactiveHealthIndicatorRegistry.class));
}
@Test // gh-18570 @Test // gh-18570
void runDoesNotFailWithoutReactorOnClasspath() { void runWhenReactorUnavailableDoesNotCreateReactiveHealthIndicatorRegistryBean() {
this.contextRunner.withClassLoader(new FilteredClassLoader(Mono.class.getPackage().getName())) this.contextRunner.withClassLoader(new FilteredClassLoader(Mono.class.getPackage().getName()))
.run((context) -> assertThat(context).hasNotFailed()); .run((context) -> assertThat(context).doesNotHaveBean(ReactiveHealthIndicatorRegistry.class));
} }
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck"> name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck">
<property name="regexp" value="true" /> <property name="regexp" value="true" />
<property name="illegalPkgs" <property name="illegalPkgs"
value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|lang|lang3|logging|pool2).*, ^com\.google\.common.*, ^org\.flywaydb\.core\.internal.*, ^org\.testcontainers\.shaded.*" /> value="^sun.*, ^org\.apache\.commons\.(?!compress|dbcp2|lang|lang3|logging|pool2).*, ^com\.google\.common.*, ^io\.micrometer\.shaded.*, ^org\.flywaydb\.core\.internal.*, ^org\.testcontainers\.shaded.*" />
<property name="illegalClasses" <property name="illegalClasses"
value="^com\.hazelcast\.util\.Base64, ^org\.junit\.rules\.ExpectedException, ^org\.mockito\.InjectMocks, ^org\.slf4j\.LoggerFactory, ^reactor\.core\.support\.Assert" /> value="^com\.hazelcast\.util\.Base64, ^org\.junit\.rules\.ExpectedException, ^org\.mockito\.InjectMocks, ^org\.slf4j\.LoggerFactory, ^reactor\.core\.support\.Assert" />
</module> </module>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment