@Test public void testDown() { Map<String, Health> healths = new HashMap<>(); Health health1 = createHealth(MOCK_HEALTH_1, new Status(IntegrationStatus.FAILED_BOOTSTRAP.name())); Health health2 = createHealth(MOCK_HEALTH_2, new Status(IntegrationStatus.FAILED_BOOTSTRAP.name())); healths.put(MOCK_HEALTH_1, health1); healths.put(MOCK_HEALTH_2, health2); Health aggregate = aggregator.aggregate(healths); assertEquals(health1.getDetails().get(DETAIL), aggregate.getDetails().get(MOCK_HEALTH_1)); assertEquals(health2.getDetails().get(DETAIL), aggregate.getDetails().get(MOCK_HEALTH_2)); assertEquals(Status.DOWN, aggregate.getStatus()); }
@Override public Health aggregate(Map<String, Health> healths) { Boolean allIntegrationsDown = true; Health.Builder builder = new Health.Builder(); for (Health health : healths.values()) { IntegrationHealth detail = (IntegrationHealth) health.getDetails().get(DETAIL); if (IntegrationStatus.ACTIVE.name().equals(health.getStatus().getCode())) { allIntegrationsDown = false; } builder.withDetail(detail.getName(), detail); } builder = allIntegrationsDown ? builder.down() : builder.up(); return builder.build(); }
ApplicationsHealthAggregator implements HealthAggregator { @Override public Health aggregate(Map<String, Health> healths) { Boolean allIntegrationsDown = true; Health.Builder builder = new Health.Builder(); for (Health health : healths.values()) { IntegrationHealth detail = (IntegrationHealth) health.getDetails().get(DETAIL); if (IntegrationStatus.ACTIVE.name().equals(health.getStatus().getCode())) { allIntegrationsDown = false; } builder.withDetail(detail.getName(), detail); } builder = allIntegrationsDown ? builder.down() : builder.up(); return builder.build(); } }
ApplicationsHealthAggregator implements HealthAggregator { @Override public Health aggregate(Map<String, Health> healths) { Boolean allIntegrationsDown = true; Health.Builder builder = new Health.Builder(); for (Health health : healths.values()) { IntegrationHealth detail = (IntegrationHealth) health.getDetails().get(DETAIL); if (IntegrationStatus.ACTIVE.name().equals(health.getStatus().getCode())) { allIntegrationsDown = false; } builder.withDetail(detail.getName(), detail); } builder = allIntegrationsDown ? builder.down() : builder.up(); return builder.build(); }  }
ApplicationsHealthAggregator implements HealthAggregator { @Override public Health aggregate(Map<String, Health> healths) { Boolean allIntegrationsDown = true; Health.Builder builder = new Health.Builder(); for (Health health : healths.values()) { IntegrationHealth detail = (IntegrationHealth) health.getDetails().get(DETAIL); if (IntegrationStatus.ACTIVE.name().equals(health.getStatus().getCode())) { allIntegrationsDown = false; } builder.withDetail(detail.getName(), detail); } builder = allIntegrationsDown ? builder.down() : builder.up(); return builder.build(); }  @Override Health aggregate(Map<String, Health> healths); }
ApplicationsHealthAggregator implements HealthAggregator { @Override public Health aggregate(Map<String, Health> healths) { Boolean allIntegrationsDown = true; Health.Builder builder = new Health.Builder(); for (Health health : healths.values()) { IntegrationHealth detail = (IntegrationHealth) health.getDetails().get(DETAIL); if (IntegrationStatus.ACTIVE.name().equals(health.getStatus().getCode())) { allIntegrationsDown = false; } builder.withDetail(detail.getName(), detail); } builder = allIntegrationsDown ? builder.down() : builder.up(); return builder.build(); }  @Override Health aggregate(Map<String, Health> healths);  }