|
|
@ -164,6 +164,19 @@ class DefaultErrorAttributesTests {
|
|
|
|
assertThat(attributes.get("message")).isEqualTo("Test");
|
|
|
|
assertThat(attributes.get("message")).isEqualTo("Test");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
@SuppressWarnings("deprecation")
|
|
|
|
|
|
|
|
void excludeExceptionWithDeprecatedConstructor() {
|
|
|
|
|
|
|
|
RuntimeException error = new RuntimeException("Test");
|
|
|
|
|
|
|
|
this.errorAttributes = new DefaultErrorAttributes(false);
|
|
|
|
|
|
|
|
MockServerHttpRequest request = MockServerHttpRequest.get("/test").build();
|
|
|
|
|
|
|
|
ServerRequest serverRequest = buildServerRequest(request, error);
|
|
|
|
|
|
|
|
Map<String, Object> attributes = this.errorAttributes.getErrorAttributes(serverRequest,
|
|
|
|
|
|
|
|
ErrorAttributeOptions.of());
|
|
|
|
|
|
|
|
assertThat(this.errorAttributes.getError(serverRequest)).isSameAs(error);
|
|
|
|
|
|
|
|
assertThat(attributes.get("exception")).isNull();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
void processResponseStatusException() {
|
|
|
|
void processResponseStatusException() {
|
|
|
|
RuntimeException nested = new RuntimeException("Test");
|
|
|
|
RuntimeException nested = new RuntimeException("Test");
|
|
|
|