@Test public void whenConnectingToDatabaseHealthCheckReturnsHealthly() { when(healthCheckService.checkDatabaseConnection()).thenReturn(true); assertEquals(true, check.check().isHealthy()); }
@Override protected Result check() { try { healthCheckService.checkDatabaseConnection(); return HealthCheck.Result.healthy("Connection to nFlow database is OK."); } catch(Exception e) { return HealthCheck.Result.unhealthy(e); } }
DatabaseConnectionHealthCheck extends HealthCheck { @Override protected Result check() { try { healthCheckService.checkDatabaseConnection(); return HealthCheck.Result.healthy("Connection to nFlow database is OK."); } catch(Exception e) { return HealthCheck.Result.unhealthy(e); } } }
DatabaseConnectionHealthCheck extends HealthCheck { @Override protected Result check() { try { healthCheckService.checkDatabaseConnection(); return HealthCheck.Result.healthy("Connection to nFlow database is OK."); } catch(Exception e) { return HealthCheck.Result.unhealthy(e); } } DatabaseConnectionHealthCheck(HealthCheckService healthCheckService); }
DatabaseConnectionHealthCheck extends HealthCheck { @Override protected Result check() { try { healthCheckService.checkDatabaseConnection(); return HealthCheck.Result.healthy("Connection to nFlow database is OK."); } catch(Exception e) { return HealthCheck.Result.unhealthy(e); } } DatabaseConnectionHealthCheck(HealthCheckService healthCheckService);  }
DatabaseConnectionHealthCheck extends HealthCheck { @Override protected Result check() { try { healthCheckService.checkDatabaseConnection(); return HealthCheck.Result.healthy("Connection to nFlow database is OK."); } catch(Exception e) { return HealthCheck.Result.unhealthy(e); } } DatabaseConnectionHealthCheck(HealthCheckService healthCheckService);   }