use of org.springframework.boot.actuate.health.HealthEndpointGroups 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();
}
use of org.springframework.boot.actuate.health.HealthEndpointGroups in project spring-boot by spring-projects.
the class AvailabilityProbesHealthEndpointGroupsPostProcessorTests method postProcessHealthEndpointGroupsWhenGroupsAlreadyContainedReturnsOriginal.
@Test
void postProcessHealthEndpointGroupsWhenGroupsAlreadyContainedReturnsOriginal() {
HealthEndpointGroups groups = mock(HealthEndpointGroups.class);
Set<String> names = new LinkedHashSet<>();
names.add("test");
names.add("readiness");
names.add("liveness");
given(groups.getNames()).willReturn(names);
assertThat(this.postProcessor.postProcessHealthEndpointGroups(groups)).isSameAs(groups);
}
use of org.springframework.boot.actuate.health.HealthEndpointGroups in project spring-boot by spring-projects.
the class AvailabilityProbesHealthEndpointGroupsTests method getWhenProbeNotInDelegateReturnsProbeGroup.
@Test
void getWhenProbeNotInDelegateReturnsProbeGroup() {
HealthEndpointGroups availabilityProbes = new AvailabilityProbesHealthEndpointGroups(this.delegate, false);
assertThat(availabilityProbes.get("liveness")).isInstanceOf(AvailabilityProbesHealthEndpointGroup.class);
}
use of org.springframework.boot.actuate.health.HealthEndpointGroups in project spring-boot by spring-projects.
the class AvailabilityProbesHealthEndpointGroupsTests method getPrimaryDelegatesToGroups.
@Test
void getPrimaryDelegatesToGroups() {
given(this.delegate.getPrimary()).willReturn(this.group);
HealthEndpointGroups availabilityProbes = new AvailabilityProbesHealthEndpointGroups(this.delegate, false);
assertThat(availabilityProbes.getPrimary()).isEqualTo(this.group);
}
use of org.springframework.boot.actuate.health.HealthEndpointGroups in project spring-boot by spring-projects.
the class AvailabilityProbesHealthEndpointGroupsTests method getNamesIncludesAvailabilityProbeGroups.
@Test
void getNamesIncludesAvailabilityProbeGroups() {
given(this.delegate.getNames()).willReturn(Collections.singleton("test"));
HealthEndpointGroups availabilityProbes = new AvailabilityProbesHealthEndpointGroups(this.delegate, false);
assertThat(availabilityProbes.getNames()).containsExactly("test", "liveness", "readiness");
}
Aggregations