Add v2 content type to actuator endpoints
Closes gh-7968
This commit is contained in:
@@ -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() {
|
||||
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user