AcsDbHealthIndicator implements HealthIndicator { @Override public Health health() { return AcsMonitoringUtilities.health(this::check, DESCRIPTION); } @Autowired  AcsDbHealthIndicator(final AcsMonitoringRepository acsMonitoringRepository); @Override Health health();  }
@Test(dataProvider = "statuses") public void testHealth(final AcsMonitoringRepository acsMonitoringRepository, final Status status, final AcsMonitoringUtilities.HealthCode healthCode, final TitanMigrationManager titanMigrationManager) throws Exception { AcsDbHealthIndicator acsDbHealthIndicator = new AcsDbHealthIndicator(acsMonitoringRepository); acsDbHealthIndicator.setMigrationManager(titanMigrationManager); Assert.assertEquals(status, acsDbHealthIndicator.health().getStatus()); Assert.assertEquals(AcsDbHealthIndicator.DESCRIPTION, acsDbHealthIndicator.health().getDetails().get(AcsMonitoringUtilities.DESCRIPTION_KEY)); if (healthCode == AcsMonitoringUtilities.HealthCode.AVAILABLE) { Assert.assertFalse(acsDbHealthIndicator.health().getDetails().containsKey(AcsMonitoringUtilities.CODE_KEY)); } else { Assert.assertEquals(healthCode, acsDbHealthIndicator.health().getDetails().get(AcsMonitoringUtilities.CODE_KEY)); } }
@Test(dataProvider = "statuses") public void testHealth(final AcsMonitoringRepository acsMonitoringRepository, final Status status, final AcsMonitoringUtilities.HealthCode healthCode, final GraphStartupManager graphStartupManager) throws Exception { AcsDbHealthIndicator acsDbHealthIndicator = new AcsDbHealthIndicator(acsMonitoringRepository); acsDbHealthIndicator.setStartupManager(graphStartupManager); Assert.assertEquals(status, acsDbHealthIndicator.health().getStatus()); Assert.assertEquals(AcsDbHealthIndicator.DESCRIPTION, acsDbHealthIndicator.health().getDetails().get(AcsMonitoringUtilities.DESCRIPTION_KEY)); if (healthCode == AcsMonitoringUtilities.HealthCode.AVAILABLE) { Assert.assertFalse(acsDbHealthIndicator.health().getDetails().containsKey(AcsMonitoringUtilities.CODE_KEY)); } else { Assert.assertEquals(healthCode, acsDbHealthIndicator.health().getDetails().get(AcsMonitoringUtilities.CODE_KEY)); } }