use of io.pravega.shared.health.TestHealthContributors.ThrowingContributor in project pravega by pravega.
the class HealthContributorTests method testIndicatorThrows.
/**
* If the {@link AbstractHealthContributor#doHealthCheck(Health.HealthBuilder)} throws an error, test that it is caught and
* a {@link Health} result that reflects an 'unhealthy' state is returned.
*/
@Test
public void testIndicatorThrows() {
@Cleanup ThrowingContributor contributor = new ThrowingContributor();
Health health = contributor.getHealthSnapshot();
Assert.assertEquals("HealthContributor should have a 'DOWN' Status.", Status.DOWN, health.getStatus());
Assert.assertTrue("HealthContributor should be not be marked ready OR alive.", !health.isAlive() && !health.isReady());
}
Aggregations