Rename WebFlux response body methods
This commit adapts to recent changes in Spring Framework. See spring-projects/spring-framework#23212
This commit is contained in:
@@ -171,7 +171,7 @@ public abstract class AbstractErrorWebExceptionHandler implements ErrorWebExcept
|
||||
}
|
||||
Resource resource = resolveResource(viewName);
|
||||
if (resource != null) {
|
||||
return responseBody.body(BodyInserters.fromResource(resource));
|
||||
return responseBody.bodyValue(BodyInserters.fromResource(resource));
|
||||
}
|
||||
return Mono.empty();
|
||||
}
|
||||
@@ -223,7 +223,7 @@ public abstract class AbstractErrorWebExceptionHandler implements ErrorWebExcept
|
||||
builder.append("<div style='white-space:pre-wrap;'>").append(htmlEscape(trace)).append("</div>");
|
||||
}
|
||||
builder.append("</body></html>");
|
||||
return responseBody.body(builder.toString());
|
||||
return responseBody.bodyValue(builder.toString());
|
||||
}
|
||||
|
||||
private String htmlEscape(Object input) {
|
||||
|
||||
@@ -111,7 +111,7 @@ class DefaultErrorWebExceptionHandlerIntegrationTests {
|
||||
void bindingResultError() {
|
||||
this.contextRunner.run((context) -> {
|
||||
WebTestClient client = getWebClient(context);
|
||||
client.post().uri("/bind").contentType(MediaType.APPLICATION_JSON).body("{}").exchange().expectStatus()
|
||||
client.post().uri("/bind").contentType(MediaType.APPLICATION_JSON).bodyValue("{}").exchange().expectStatus()
|
||||
.isBadRequest().expectBody().jsonPath("status").isEqualTo("400").jsonPath("error")
|
||||
.isEqualTo(HttpStatus.BAD_REQUEST.getReasonPhrase()).jsonPath("path").isEqualTo(("/bind"))
|
||||
.jsonPath("exception").doesNotExist().jsonPath("errors").isArray().jsonPath("message").isNotEmpty()
|
||||
|
||||
Reference in New Issue
Block a user