mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-15 01:07:30 +08:00
Polish
See gh-12838
This commit is contained in:
parent
d49cc20e79
commit
8397878857
@ -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=")
|
||||
|
@ -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");
|
||||
});
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user