@Test public void noStatuses() throws Exception { Map<String, Health> healths = new HashMap<>(); Assert.assertEquals(this.healthAggregator.aggregate(healths).getStatus(), Status.UNKNOWN); }
@Override public final Health aggregate(final Map<String, Health> healths) { List<Status> statusCandidates = new ArrayList<>(); for (Map.Entry<String, Health> entry : healths.entrySet()) { Status status = entry.getValue().getStatus(); if (entry.getKey().toLowerCase().contains("cache")) { if (status.equals(Status.DOWN)) { statusCandidates.add(DEGRADED_STATUS); } else if (status.equals(Status.UNKNOWN)) { statusCandidates.add(Status.UP); } } else { statusCandidates.add(entry.getValue().getStatus()); } } Status status = this.aggregateStatus(statusCandidates); Map<String, Object> details = aggregateDetails(healths); return new Health.Builder(status, details).build(); }
AcsHealthAggregator implements HealthAggregator { @Override public final Health aggregate(final Map<String, Health> healths) { List<Status> statusCandidates = new ArrayList<>(); for (Map.Entry<String, Health> entry : healths.entrySet()) { Status status = entry.getValue().getStatus(); if (entry.getKey().toLowerCase().contains("cache")) { if (status.equals(Status.DOWN)) { statusCandidates.add(DEGRADED_STATUS); } else if (status.equals(Status.UNKNOWN)) { statusCandidates.add(Status.UP); } } else { statusCandidates.add(entry.getValue().getStatus()); } } Status status = this.aggregateStatus(statusCandidates); Map<String, Object> details = aggregateDetails(healths); return new Health.Builder(status, details).build(); } }
AcsHealthAggregator implements HealthAggregator { @Override public final Health aggregate(final Map<String, Health> healths) { List<Status> statusCandidates = new ArrayList<>(); for (Map.Entry<String, Health> entry : healths.entrySet()) { Status status = entry.getValue().getStatus(); if (entry.getKey().toLowerCase().contains("cache")) { if (status.equals(Status.DOWN)) { statusCandidates.add(DEGRADED_STATUS); } else if (status.equals(Status.UNKNOWN)) { statusCandidates.add(Status.UP); } } else { statusCandidates.add(entry.getValue().getStatus()); } } Status status = this.aggregateStatus(statusCandidates); Map<String, Object> details = aggregateDetails(healths); return new Health.Builder(status, details).build(); } AcsHealthAggregator(); }
AcsHealthAggregator implements HealthAggregator { @Override public final Health aggregate(final Map<String, Health> healths) { List<Status> statusCandidates = new ArrayList<>(); for (Map.Entry<String, Health> entry : healths.entrySet()) { Status status = entry.getValue().getStatus(); if (entry.getKey().toLowerCase().contains("cache")) { if (status.equals(Status.DOWN)) { statusCandidates.add(DEGRADED_STATUS); } else if (status.equals(Status.UNKNOWN)) { statusCandidates.add(Status.UP); } } else { statusCandidates.add(entry.getValue().getStatus()); } } Status status = this.aggregateStatus(statusCandidates); Map<String, Object> details = aggregateDetails(healths); return new Health.Builder(status, details).build(); } AcsHealthAggregator(); @Override final Health aggregate(final Map<String, Health> healths); }
AcsHealthAggregator implements HealthAggregator { @Override public final Health aggregate(final Map<String, Health> healths) { List<Status> statusCandidates = new ArrayList<>(); for (Map.Entry<String, Health> entry : healths.entrySet()) { Status status = entry.getValue().getStatus(); if (entry.getKey().toLowerCase().contains("cache")) { if (status.equals(Status.DOWN)) { statusCandidates.add(DEGRADED_STATUS); } else if (status.equals(Status.UNKNOWN)) { statusCandidates.add(Status.UP); } } else { statusCandidates.add(entry.getValue().getStatus()); } } Status status = this.aggregateStatus(statusCandidates); Map<String, Object> details = aggregateDetails(healths); return new Health.Builder(status, details).build(); } AcsHealthAggregator(); @Override final Health aggregate(final Map<String, Health> healths);  }