Search in sources :

Example 1 with HealthContributor

use of org.springframework.boot.actuate.health.HealthContributor in project spring-boot by spring-projects.

the class AutoConfiguredHealthContributorRegistryTests method registerContributorWithGroupNameThrowsException.

@Test
void registerContributorWithGroupNameThrowsException() {
    HealthContributorRegistry registry = new AutoConfiguredHealthContributorRegistry(Collections.emptyMap(), Arrays.asList("spring", "boot"));
    assertThatIllegalStateException().isThrownBy(() -> registry.registerContributor("spring", mock(HealthContributor.class))).withMessage("HealthContributor with name \"spring\" clashes with group");
}
Also used : HealthContributorRegistry(org.springframework.boot.actuate.health.HealthContributorRegistry) HealthContributor(org.springframework.boot.actuate.health.HealthContributor) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 HealthContributor (org.springframework.boot.actuate.health.HealthContributor)1 HealthContributorRegistry (org.springframework.boot.actuate.health.HealthContributorRegistry)1