|
|
|
@ -74,15 +74,17 @@ public class AuditEventsMvcEndpointTests { |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void contentTypeDefaultsToActuatorV2Json() throws Exception { |
|
|
|
public void contentTypeDefaultsToActuatorV2Json() throws Exception { |
|
|
|
this.mvc.perform(get("/application/auditevents")).andExpect(status().isOk()) |
|
|
|
this.mvc.perform(get("/application/auditevents").param("after", "2016-11-01T10:00:00+0000")) |
|
|
|
|
|
|
|
.andExpect(status().isOk()) |
|
|
|
.andExpect(header().string("Content-Type", |
|
|
|
.andExpect(header().string("Content-Type", |
|
|
|
"application/vnd.spring-boot.actuator.v2+json;charset=UTF-8")); |
|
|
|
"application/vnd.spring-boot.actuator.v2+json;charset=UTF-8")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void contentTypeCanBeApplicationJson() throws Exception { |
|
|
|
public void contentTypeCanBeApplicationJson() throws Exception { |
|
|
|
this.mvc.perform(get("/application/auditevents").header(HttpHeaders.ACCEPT, |
|
|
|
this.mvc.perform(get("/application/auditevents").param("after", "2016-11-01T10:00:00+0000") |
|
|
|
MediaType.APPLICATION_JSON_VALUE)).andExpect(status().isOk()) |
|
|
|
.header(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE)) |
|
|
|
|
|
|
|
.andExpect(status().isOk()) |
|
|
|
.andExpect(header().string("Content-Type", |
|
|
|
.andExpect(header().string("Content-Type", |
|
|
|
MediaType.APPLICATION_JSON_UTF8_VALUE)); |
|
|
|
MediaType.APPLICATION_JSON_UTF8_VALUE)); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -121,6 +123,12 @@ public class AuditEventsMvcEndpointTests { |
|
|
|
.andExpect(content().string(not(containsString("login")))); |
|
|
|
.andExpect(content().string(not(containsString("login")))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void invokeFilterWithoutDateAfterReturnBadRequestStatus() throws Exception { |
|
|
|
|
|
|
|
this.mvc.perform(get("/application/auditevents")) |
|
|
|
|
|
|
|
.andExpect(status().isBadRequest()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Import({ JacksonAutoConfiguration.class, |
|
|
|
@Import({ JacksonAutoConfiguration.class, |
|
|
|
HttpMessageConvertersAutoConfiguration.class, |
|
|
|
HttpMessageConvertersAutoConfiguration.class, |
|
|
|
EndpointWebMvcAutoConfiguration.class, WebMvcAutoConfiguration.class }) |
|
|
|
EndpointWebMvcAutoConfiguration.class, WebMvcAutoConfiguration.class }) |
|
|
|
|