use of io.pravega.shared.health.Status in project pravega by pravega.
the class SegmentContainerRegistryHealthContributorTest method testSegmentContainerHealth.
/**
* Check health of SegmentContainerRegistry with different states.
*/
@Test
public void testSegmentContainerHealth() {
when(segmentContainerRegistry.isClosed()).thenReturn(true);
Health.HealthBuilder builder = Health.builder().name(segmentContainerRegistryHealthContributor.getName());
Status health = segmentContainerRegistryHealthContributor.doHealthCheck(builder);
Assert.assertEquals("HealthContributor should report an 'DOWN' Status.", Status.DOWN, health);
when(segmentContainerRegistry.isClosed()).thenReturn(false);
health = segmentContainerRegistryHealthContributor.doHealthCheck(builder);
Assert.assertEquals("HealthContributor should report an 'UP' Status.", Status.UP, health);
}
Aggregations