use of org.springframework.boot.actuate.health.ReactiveHealthContributorRegistry in project spring-boot by spring-projects.
the class HealthEndpointAutoConfigurationTests method runCreatesReactiveHealthContributorRegistryContainingAdaptedBeans.
@Test
void runCreatesReactiveHealthContributorRegistryContainingAdaptedBeans() {
this.reactiveContextRunner.run((context) -> {
ReactiveHealthContributorRegistry registry = context.getBean(ReactiveHealthContributorRegistry.class);
Object[] names = registry.stream().map(NamedContributor::getName).toArray();
assertThat(names).containsExactlyInAnyOrder("simple", "additional", "reactive", "ping");
});
}
use of org.springframework.boot.actuate.health.ReactiveHealthContributorRegistry in project spring-boot by spring-projects.
the class AutoConfiguredReactiveHealthContributorRegistryTests method registerContributorWithGroupNameThrowsException.
@Test
void registerContributorWithGroupNameThrowsException() {
ReactiveHealthContributorRegistry registry = new AutoConfiguredReactiveHealthContributorRegistry(Collections.emptyMap(), Arrays.asList("spring", "boot"));
assertThatIllegalStateException().isThrownBy(() -> registry.registerContributor("spring", mock(ReactiveHealthContributor.class))).withMessage("ReactiveHealthContributor with name \"spring\" clashes with group");
}
use of org.springframework.boot.actuate.health.ReactiveHealthContributorRegistry in project spring-boot by spring-projects.
the class HealthEndpointAutoConfigurationTests method runWhenHasReactiveHealthContributorRegistryBeanDoesNotCreateAdditionalReactiveHealthContributorRegistry.
@Test
void runWhenHasReactiveHealthContributorRegistryBeanDoesNotCreateAdditionalReactiveHealthContributorRegistry() {
this.reactiveContextRunner.withUserConfiguration(ReactiveHealthContributorRegistryConfiguration.class).run((context) -> {
ReactiveHealthContributorRegistry registry = context.getBean(ReactiveHealthContributorRegistry.class);
Object[] names = registry.stream().map(NamedContributor::getName).toArray();
assertThat(names).isEmpty();
});
}
Aggregations