Search in sources :

Example 1 with Neo4jHealthIndicator

use of org.springframework.boot.actuate.neo4j.Neo4jHealthIndicator in project spring-boot by spring-projects.

the class Neo4jHealthContributorAutoConfigurationTests method defaultIndicatorCanBeReplaced.

@Test
void defaultIndicatorCanBeReplaced() {
    this.contextRunner.withUserConfiguration(Neo4jConfiguration.class, CustomIndicatorConfiguration.class).run((context) -> {
        assertThat(context).hasBean("neo4jHealthIndicator");
        Health health = context.getBean("neo4jHealthIndicator", HealthIndicator.class).health();
        assertThat(health.getDetails()).containsOnly(entry("test", true));
    });
}
Also used : Health(org.springframework.boot.actuate.health.Health) HealthIndicator(org.springframework.boot.actuate.health.HealthIndicator) AbstractHealthIndicator(org.springframework.boot.actuate.health.AbstractHealthIndicator) Neo4jHealthIndicator(org.springframework.boot.actuate.neo4j.Neo4jHealthIndicator) Neo4jReactiveHealthIndicator(org.springframework.boot.actuate.neo4j.Neo4jReactiveHealthIndicator) Test(org.junit.jupiter.api.Test)

Aggregations

Test (org.junit.jupiter.api.Test)1 AbstractHealthIndicator (org.springframework.boot.actuate.health.AbstractHealthIndicator)1 Health (org.springframework.boot.actuate.health.Health)1 HealthIndicator (org.springframework.boot.actuate.health.HealthIndicator)1 Neo4jHealthIndicator (org.springframework.boot.actuate.neo4j.Neo4jHealthIndicator)1 Neo4jReactiveHealthIndicator (org.springframework.boot.actuate.neo4j.Neo4jReactiveHealthIndicator)1