Search in sources :

Example 1 with HealthEndpointGroups

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

the class AvailabilityProbesHealthEndpointGroupsTests method getWhenNotProbeAndNotInDelegateReturnsNull.

@Test
void getWhenNotProbeAndNotInDelegateReturnsNull() {
    HealthEndpointGroups availabilityProbes = new AvailabilityProbesHealthEndpointGroups(this.delegate, false);
    assertThat(availabilityProbes.get("mygroup")).isNull();
}
Also used : HealthEndpointGroups(org.springframework.boot.actuate.health.HealthEndpointGroups) Test(org.junit.jupiter.api.Test)

Example 2 with HealthEndpointGroups

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

the class AvailabilityProbesHealthEndpointGroupsTests method getReadinessProbeHasOnlyReadinessStateAsMember.

@Test
void getReadinessProbeHasOnlyReadinessStateAsMember() {
    HealthEndpointGroups availabilityProbes = new AvailabilityProbesHealthEndpointGroups(this.delegate, false);
    HealthEndpointGroup probeGroup = availabilityProbes.get("readiness");
    assertThat(probeGroup.isMember("livenessState")).isFalse();
    assertThat(probeGroup.isMember("readinessState")).isTrue();
}
Also used : HealthEndpointGroups(org.springframework.boot.actuate.health.HealthEndpointGroups) HealthEndpointGroup(org.springframework.boot.actuate.health.HealthEndpointGroup) Test(org.junit.jupiter.api.Test)

Example 3 with HealthEndpointGroups

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

the class AvailabilityProbesHealthEndpointGroupsTests method getWhenProbeInDelegateReturnsGroupFromDelegate.

@Test
void getWhenProbeInDelegateReturnsGroupFromDelegate() {
    given(this.delegate.get("liveness")).willReturn(this.group);
    HealthEndpointGroups availabilityProbes = new AvailabilityProbesHealthEndpointGroups(this.delegate, false);
    assertThat(availabilityProbes.get("liveness")).isEqualTo(this.group);
}
Also used : HealthEndpointGroups(org.springframework.boot.actuate.health.HealthEndpointGroups) Test(org.junit.jupiter.api.Test)

Example 4 with HealthEndpointGroups

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

the class AvailabilityProbesHealthEndpointGroupsPostProcessorTests method postProcessHealthEndpointGroupsWhenAdditionalPathPropertyIsTrue.

@Test
void postProcessHealthEndpointGroupsWhenAdditionalPathPropertyIsTrue() {
    HealthEndpointGroups postProcessed = getPostProcessed("true");
    HealthEndpointGroup liveness = postProcessed.get("liveness");
    HealthEndpointGroup readiness = postProcessed.get("readiness");
    assertThat(liveness.getAdditionalPath().toString()).isEqualTo("server:/livez");
    assertThat(readiness.getAdditionalPath().toString()).isEqualTo("server:/readyz");
}
Also used : HealthEndpointGroups(org.springframework.boot.actuate.health.HealthEndpointGroups) HealthEndpointGroup(org.springframework.boot.actuate.health.HealthEndpointGroup) Test(org.junit.jupiter.api.Test)

Example 5 with HealthEndpointGroups

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

the class AvailabilityProbesHealthEndpointGroupsPostProcessorTests method postProcessHealthEndpointGroupsWhenAdditionalPathPropertyIsFalse.

@Test
void postProcessHealthEndpointGroupsWhenAdditionalPathPropertyIsFalse() {
    HealthEndpointGroups postProcessed = getPostProcessed("false");
    HealthEndpointGroup liveness = postProcessed.get("liveness");
    HealthEndpointGroup readiness = postProcessed.get("readiness");
    assertThat(liveness.getAdditionalPath()).isNull();
    assertThat(readiness.getAdditionalPath()).isNull();
}
Also used : HealthEndpointGroups(org.springframework.boot.actuate.health.HealthEndpointGroups) HealthEndpointGroup(org.springframework.boot.actuate.health.HealthEndpointGroup) Test(org.junit.jupiter.api.Test)

Aggregations

HealthEndpointGroups (org.springframework.boot.actuate.health.HealthEndpointGroups)35 Test (org.junit.jupiter.api.Test)34 HealthEndpointGroup (org.springframework.boot.actuate.health.HealthEndpointGroup)22 LinkedHashSet (java.util.LinkedHashSet)3 MockEnvironment (org.springframework.mock.env.MockEnvironment)1