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();
}
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();
}
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);
}
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");
}
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();
}
Aggregations