This commit is contained in:
Phillip Webb
2017-04-17 22:08:51 -07:00
parent 3fe0b844a6
commit f46d799f31
8 changed files with 37 additions and 24 deletions

View File

@@ -108,7 +108,8 @@ public class HealthMvcEndpointAutoConfigurationTests {
public void endpointConditionalOnMissingBean() throws Exception {
this.context = new AnnotationConfigWebApplicationContext();
this.context.setServletContext(new MockServletContext());
this.context.register(TestConfiguration.class, TestHealthMvcEndpointConfiguration.class);
this.context.register(TestConfiguration.class,
TestHealthMvcEndpointConfiguration.class);
this.context.refresh();
MockHttpServletRequest request = new MockHttpServletRequest();
Health health = (Health) this.context.getBean(HealthMvcEndpoint.class)
@@ -142,6 +143,7 @@ public class HealthMvcEndpointAutoConfigurationTests {
public HealthMvcEndpoint endpoint(HealthEndpoint endpoint) {
return new TestHealthMvcEndpoint(endpoint);
}
}
static class TestHealthMvcEndpoint extends HealthMvcEndpoint {
@@ -151,9 +153,11 @@ public class HealthMvcEndpointAutoConfigurationTests {
}
@Override
protected boolean exposeHealthDetails(HttpServletRequest request, Principal principal) {
protected boolean exposeHealthDetails(HttpServletRequest request,
Principal principal) {
return true;
}
}
static class TestHealthIndicator extends AbstractHealthIndicator {