use of org.springframework.boot.actuate.health.HealthEndpointGroup in project spring-boot by spring-projects.
the class AdditionalHealthEndpointPathsWebMvcHandlerMapping method initHandlerMethods.
@Override
protected void initHandlerMethods() {
for (WebOperation operation : this.endpoint.getOperations()) {
WebOperationRequestPredicate predicate = operation.getRequestPredicate();
String matchAllRemainingPathSegmentsVariable = predicate.getMatchAllRemainingPathSegmentsVariable();
if (matchAllRemainingPathSegmentsVariable != null) {
for (HealthEndpointGroup group : this.groups) {
AdditionalHealthEndpointPath additionalPath = group.getAdditionalPath();
if (additionalPath != null) {
registerMapping(this.endpoint, predicate, operation, additionalPath.getValue());
}
}
}
}
}
use of org.springframework.boot.actuate.health.HealthEndpointGroup 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.HealthEndpointGroup 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();
}
use of org.springframework.boot.actuate.health.HealthEndpointGroup 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.HealthEndpointGroup in project spring-boot by spring-projects.
the class AvailabilityProbesHealthEndpointGroupsPostProcessorTests method postProcessHealthEndpointGroupsWhenAdditionalPathPropertyIsNull.
@Test
void postProcessHealthEndpointGroupsWhenAdditionalPathPropertyIsNull() {
HealthEndpointGroups groups = mock(HealthEndpointGroups.class);
HealthEndpointGroups postProcessed = this.postProcessor.postProcessHealthEndpointGroups(groups);
HealthEndpointGroup liveness = postProcessed.get("liveness");
HealthEndpointGroup readiness = postProcessed.get("readiness");
assertThat(liveness.getAdditionalPath()).isNull();
assertThat(readiness.getAdditionalPath()).isNull();
}
Aggregations