ZacHealthIndicator implements HealthIndicator { @Override public Health health() { return AcsMonitoringUtilities.health(this::check, this.getDescription()); } @Autowired  ZacHealthIndicator(final RestTemplate zacTemplate); @Override Health health();  }
@Test(dataProvider = "statuses") public void testHealth(final RestTemplate restTemplate, final Status status, final AcsMonitoringUtilities.HealthCode healthCode) throws Exception { ZacHealthIndicator zacHealthIndicator = new ZacHealthIndicator(restTemplate); Assert.assertEquals(status, zacHealthIndicator.health().getStatus()); Assert.assertEquals(zacHealthIndicator.getDescription(), zacHealthIndicator.health().getDetails().get(AcsMonitoringUtilities.DESCRIPTION_KEY)); if (healthCode == AcsMonitoringUtilities.HealthCode.AVAILABLE) { Assert.assertFalse(zacHealthIndicator.health().getDetails().containsKey(AcsMonitoringUtilities.CODE_KEY)); } else { Assert.assertEquals(healthCode, zacHealthIndicator.health().getDetails().get(AcsMonitoringUtilities.CODE_KEY)); } }