@Test public void check_WhenSimbaIsNotAlive_ReturnsUnhealthy() throws Exception { when(simbaGatewayMock.isSimbaAlive()).thenReturn(false); Result actual = simbaHealthCheck.check(); assertThat(actual).isEqualTo(Result.unhealthy("Could not establish connection")); }
@Test public void check_WhenSimbaIsAlive_ReturnsHealthy() throws Exception { when(simbaGatewayMock.isSimbaAlive()).thenReturn(true); Result actual = simbaHealthCheck.check(); assertThat(actual).isEqualTo(Result.healthy()); }