Rework HealthEndpoint and HealthIndicator

With this commit the state of a component or subsystem becomes a first-class citizen in Boot's application health support. HealthIndicators now return a Health instance with status and some contextual details.

An aggregation strategy has been introduced to aggregate several Health instances into one final application Health instance. Out of the box OrderedHealthAggregator can be configured to allow different ordering or a custom HealthAggregator bean can be registered.
This commit is contained in:
Christian Dupuis
2014-05-21 18:26:02 +02:00
parent d59cbc830a
commit 4648188782
28 changed files with 695 additions and 185 deletions

View File

@@ -68,6 +68,6 @@ public class EndpointsPropertiesSampleActuatorApplicationTests {
"http://localhost:" + this.port + "/admin/health", String.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
assertTrue("Wrong body: " + entity.getBody(),
entity.getBody().contains("\"status\":\"ok\""));
entity.getBody().contains("\"status\":\"UP\""));
}
}

View File

@@ -73,7 +73,7 @@ public class ManagementAddressActuatorApplicationTests {
String.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
assertTrue("Wrong body: " + entity.getBody(),
entity.getBody().contains("\"status\":\"ok\""));
entity.getBody().contains("\"status\":\"UP\""));
}
}

View File

@@ -82,7 +82,7 @@ public class ManagementPortSampleActuatorApplicationTests {
"http://localhost:" + this.managementPort + "/health", String.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
assertTrue("Wrong body: " + entity.getBody(),
entity.getBody().contains("\"status\":\"ok\""));
entity.getBody().contains("\"status\":\"UP\""));
}
@Test

View File

@@ -131,7 +131,7 @@ public class SampleActuatorApplicationTests {
"http://localhost:" + this.port + "/health", String.class);
assertEquals(HttpStatus.OK, entity.getStatusCode());
assertTrue("Wrong body: " + entity.getBody(),
entity.getBody().contains("\"status\":\"ok\""));
entity.getBody().contains("\"status\":\"UP\""));
}
@Test