Move all actuators under /application

Context path can be configured via `management.context-path`.

Closes gh-6886
This commit is contained in:
Madhura Bhave
2016-10-13 10:32:38 -07:00
parent 92468d4ffc
commit bcd79dd992
47 changed files with 242 additions and 186 deletions

View File

@@ -97,7 +97,7 @@ public class EndpointDocumentation {
@Test
public void logfile() throws Exception {
this.mockMvc.perform(get("/logfile").accept(MediaType.TEXT_PLAIN))
this.mockMvc.perform(get("/application/logfile").accept(MediaType.TEXT_PLAIN))
.andExpect(status().isOk()).andDo(document("logfile"));
}
@@ -106,7 +106,7 @@ public class EndpointDocumentation {
FileCopyUtils.copy(getClass().getResourceAsStream("log.txt"),
new FileOutputStream(LOG_FILE));
this.mockMvc
.perform(get("/logfile").accept(MediaType.TEXT_PLAIN)
.perform(get("/application/logfile").accept(MediaType.TEXT_PLAIN)
.header(HttpHeaders.RANGE, "bytes=0-1024"))
.andExpect(status().isPartialContent())
.andDo(document("partial-logfile"));
@@ -115,7 +115,7 @@ public class EndpointDocumentation {
@Test
public void singleLogger() throws Exception {
this.mockMvc
.perform(get("/loggers/org.springframework.boot")
.perform(get("/application/loggers/org.springframework.boot")
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk()).andDo(document("single-logger"));
}
@@ -123,7 +123,7 @@ public class EndpointDocumentation {
@Test
public void setLogger() throws Exception {
this.mockMvc
.perform(post("/loggers/org.springframework.boot")
.perform(post("/application/loggers/org.springframework.boot")
.contentType(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON)
.content("{\"configuredLevel\": \"DEBUG\"}"))
.andExpect(status().isOk()).andDo(document("set-logger"));
@@ -132,7 +132,7 @@ public class EndpointDocumentation {
@Test
public void auditEvents() throws Exception {
this.mockMvc
.perform(get("/auditevents").param("after", "2016-11-01T10:00:00+0000")
.perform(get("/application/auditevents").param("after", "2016-11-01T10:00:00+0000")
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON))
.andExpect(status().isOk()).andDo(document("auditevents"));
}
@@ -140,7 +140,7 @@ public class EndpointDocumentation {
@Test
public void auditEventsByPrincipal() throws Exception {
this.mockMvc
.perform(get("/auditevents").param("principal", "admin")
.perform(get("/application/auditevents").param("principal", "admin")
.param("after", "2016-11-01T10:00:00+0000")
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON))
.andExpect(status().isOk())
@@ -150,7 +150,7 @@ public class EndpointDocumentation {
@Test
public void auditEventsByPrincipalAndType() throws Exception {
this.mockMvc
.perform(get("/auditevents").param("principal", "admin")
.perform(get("/application/auditevents").param("principal", "admin")
.param("after", "2016-11-01T10:00:00+0000")
.param("type", "AUTHENTICATION_SUCCESS")
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON))
@@ -171,7 +171,7 @@ public class EndpointDocumentation {
String output = endpointPath.substring(1);
output = output.length() > 0 ? output : "./";
this.mockMvc
.perform(get(endpointPath)
.perform(get("/application" + endpointPath)
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON))
.andExpect(status().isOk()).andDo(document(output))
.andDo(new ResultHandler() {

View File

@@ -51,7 +51,7 @@ public class HealthEndpointDocumentation {
@Test
public void health() throws Exception {
this.mockMvc
.perform(get("/health")
.perform(get("/application/health")
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON))
.andExpect(status().isOk()).andDo(document("health/insensitive"));
}

View File

@@ -52,7 +52,7 @@ public class HypermediaEndpointDocumentation {
@Test
public void beans() throws Exception {
this.mockMvc
.perform(get("/beans")
.perform(get("/application/beans")
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON))
.andExpect(status().isOk()).andDo(document("beans/hypermedia"));
}
@@ -60,18 +60,18 @@ public class HypermediaEndpointDocumentation {
@Test
public void metrics() throws Exception {
this.mockMvc
.perform(get("/metrics")
.perform(get("/application/metrics")
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON))
.andExpect(status().isOk())
.andExpect(jsonPath("$._links.self.href")
.value("http://localhost:8080/metrics"))
.value("http://localhost:8080/application/metrics"))
.andDo(document("metrics/hypermedia"));
}
@Test
public void home() throws Exception {
this.mockMvc
.perform(get("/actuator")
.perform(get("/application")
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON))
.andExpect(status().isOk()).andDo(document("admin"));
}