Add v2 content type to actuator endpoints

Closes gh-7968
This commit is contained in:
Madhura Bhave
2017-03-27 11:10:44 -07:00
parent 28a4d5e01b
commit 8bfd42e3f1
14 changed files with 44 additions and 32 deletions

View File

@@ -124,7 +124,7 @@ public class EndpointDocumentation {
public void setLogger() throws Exception {
this.mockMvc
.perform(post("/loggers/org.springframework.boot")
.contentType(ActuatorMediaTypes.APPLICATION_ACTUATOR_V1_JSON)
.contentType(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON)
.content("{\"configuredLevel\": \"DEBUG\"}"))
.andExpect(status().isOk()).andDo(document("set-logger"));
}
@@ -133,7 +133,7 @@ public class EndpointDocumentation {
public void auditEvents() throws Exception {
this.mockMvc
.perform(get("/auditevents").param("after", "2016-11-01T10:00:00+0000")
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V1_JSON))
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON))
.andExpect(status().isOk()).andDo(document("auditevents"));
}
@@ -142,7 +142,7 @@ public class EndpointDocumentation {
this.mockMvc
.perform(get("/auditevents").param("principal", "admin")
.param("after", "2016-11-01T10:00:00+0000")
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V1_JSON))
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON))
.andExpect(status().isOk())
.andDo(document("auditevents/filter-by-principal"));
}
@@ -153,7 +153,7 @@ public class EndpointDocumentation {
.perform(get("/auditevents").param("principal", "admin")
.param("after", "2016-11-01T10:00:00+0000")
.param("type", "AUTHENTICATION_SUCCESS")
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V1_JSON))
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON))
.andExpect(status().isOk())
.andDo(document("auditevents/filter-by-principal-and-type"));
}
@@ -172,7 +172,7 @@ public class EndpointDocumentation {
output = output.length() > 0 ? output : "./";
this.mockMvc
.perform(get(endpointPath)
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V1_JSON))
.accept(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON))
.andExpect(status().isOk()).andDo(document(output))
.andDo(new ResultHandler() {

View File

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

View File

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