Commit 60a50a7a authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #8919 from eddumelendez:gh-8814

* pr/8919:
  Modify return on post /loggers to HTTP 204
parents 2ccefbc2 ce0b1b24
......@@ -126,7 +126,7 @@ public class EndpointDocumentation {
.perform(post("/application/loggers/org.springframework.boot")
.contentType(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON)
.content("{\"configuredLevel\": \"DEBUG\"}"))
.andExpect(status().isOk()).andDo(document("set-logger"));
.andExpect(status().isNoContent()).andDo(document("set-logger"));
}
@Test
......
......@@ -71,7 +71,7 @@ public class LoggersMvcEndpoint extends EndpointMvcAdapter {
try {
LogLevel logLevel = getLogLevel(configuration);
this.delegate.setLogLevel(name, logLevel);
return ResponseEntity.ok().build();
return ResponseEntity.noContent().build();
}
catch (IllegalArgumentException ex) {
return ResponseEntity.badRequest().build();
......
......@@ -150,7 +150,7 @@ public class LoggersMvcEndpointTests {
@Test
public void setLoggerUsingApplicationJsonShouldSetLogLevel() throws Exception {
this.mvc.perform(post(PATH + "/ROOT").contentType(MediaType.APPLICATION_JSON)
.content("{\"configuredLevel\":\"debug\"}")).andExpect(status().isOk());
.content("{\"configuredLevel\":\"debug\"}")).andExpect(status().isNoContent());
verify(this.loggingSystem).setLogLevel("ROOT", LogLevel.DEBUG);
}
......@@ -158,7 +158,7 @@ public class LoggersMvcEndpointTests {
public void setLoggerUsingActuatorV2JsonShouldSetLogLevel() throws Exception {
this.mvc.perform(post(PATH + "/ROOT")
.contentType(ActuatorMediaTypes.APPLICATION_ACTUATOR_V2_JSON)
.content("{\"configuredLevel\":\"debug\"}")).andExpect(status().isOk());
.content("{\"configuredLevel\":\"debug\"}")).andExpect(status().isNoContent());
verify(this.loggingSystem).setLogLevel("ROOT", LogLevel.DEBUG);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment