See gh-12838
This commit is contained in:
Brian Clozel 2018-10-16 10:13:40 +02:00
parent d49cc20e79
commit 8397878857
3 changed files with 5 additions and 4 deletions

View File

@ -225,7 +225,7 @@ public class ErrorMvcAutoConfiguration {
response.setContentType(getContentType());
}
builder.append("<html><body><h1>Whitelabel Error Page</h1>").append(
"<p>This application has no configured error view, so you are seeing this as a fallback.</p>")
"<p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p>")
.append("<div id='created'>").append(timestamp).append("</div>")
.append("<div>There was an unexpected error (type=")
.append(htmlEscape(model.get("error"))).append(", status=")

View File

@ -58,7 +58,9 @@ public class ErrorMvcAutoConfigurationTests {
webRequest.getRequest(), webRequest.getResponse());
String responseString = ((MockHttpServletResponse) webRequest.getResponse())
.getContentAsString();
assertThat(responseString).contains("<div>Exception message</div>")
assertThat(responseString).contains(
"<p>This application has no explicit mapping for /error, so you are seeing this as a fallback.</p>")
.contains("<div>Exception message</div>")
.contains("<div>java.lang.IllegalStateException");
});
}

View File

@ -161,8 +161,7 @@ public class SampleActuatorApplicationTests {
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR);
String body = entity.getBody();
assertThat(body).as("Body was null").isNotNull();
assertThat(body).contains(
"This application has no configured error view, so you are seeing this as a fallback.");
assertThat(body).contains("This application has no explicit mapping for /error");
}
@Test