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:
@@ -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\""));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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\""));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user