Rename ServerResponse.BodyBuilder.body to syncBody
This commit renames the `body(Object)` on ServerResponse to `syncBody(Object)`. The reason for this is that the original method name clashed with the `body(Publisher)` method in the Kotlin extension. The new name nicely reflects the synchronous nature of the method, making it less appealing than the `Publisher`-based `body` method. Issue: SPR-15467
This commit is contained in:
@@ -121,7 +121,7 @@ public class DefaultWebClientTests {
|
||||
Mono<Void> mono = Mono.empty();
|
||||
WebClient client = builder().build();
|
||||
|
||||
client.post().uri("http://example.com").body(mono);
|
||||
client.post().uri("http://example.com").syncBody(mono);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -294,7 +294,7 @@ public class WebClientIntegrationTests {
|
||||
.uri("/pojo/capitalize")
|
||||
.accept(MediaType.APPLICATION_JSON)
|
||||
.contentType(MediaType.APPLICATION_JSON)
|
||||
.body(new Pojo("foofoo", "barbar"))
|
||||
.syncBody(new Pojo("foofoo", "barbar"))
|
||||
.exchange()
|
||||
.flatMap(response -> response.bodyToMono(Pojo.class));
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ public class DefaultServerResponseBuilderTests {
|
||||
public void bodyObjectPublisher() throws Exception {
|
||||
Mono<Void> mono = Mono.empty();
|
||||
|
||||
ServerResponse.ok().body(mono);
|
||||
ServerResponse.ok().syncBody(mono);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -81,11 +81,11 @@ public class NestedRouteIntegrationTests extends AbstractRouterFunctionIntegrati
|
||||
private static class NestedHandler {
|
||||
|
||||
public Mono<ServerResponse> bar(ServerRequest request) {
|
||||
return ServerResponse.ok().body("bar");
|
||||
return ServerResponse.ok().syncBody("bar");
|
||||
}
|
||||
|
||||
public Mono<ServerResponse> baz(ServerRequest request) {
|
||||
return ServerResponse.ok().body("baz");
|
||||
return ServerResponse.ok().syncBody("baz");
|
||||
}
|
||||
|
||||
public Mono<ServerResponse> variables(ServerRequest request) {
|
||||
|
||||
Reference in New Issue
Block a user