Fix health status aggregation bug

This commit is contained in:
Christian Dupuis
2014-10-28 12:46:14 +01:00
parent cebfd44d16
commit 6c66ff78c0
5 changed files with 62 additions and 13 deletions

View File

@@ -45,8 +45,8 @@ public class HealthEndpointTests extends AbstractEndpointTests<HealthEndpoint> {
@Test
public void invoke() throws Exception {
Status result = new Status("FINE");
assertThat(getEndpointBean().invoke().getStatus(), equalTo(result));
// As FINE isn't configured in the order we get UNKOWN
assertThat(getEndpointBean().invoke().getStatus(), equalTo(Status.UNKNOWN));
}
@Configuration

View File

@@ -69,8 +69,7 @@ public class OrderedHealthAggregatorTests {
healths.put("h3", new Health.Builder().status(Status.UNKNOWN).build());
healths.put("h4", new Health.Builder().status(Status.OUT_OF_SERVICE).build());
healths.put("h5", new Health.Builder().status(new Status("CUSTOM")).build());
assertEquals(new Status("CUSTOM"), this.healthAggregator.aggregate(healths)
.getStatus());
assertEquals(Status.DOWN, this.healthAggregator.aggregate(healths).getStatus());
}
@Test