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:
Arjen Poutsma
2017-04-24 17:15:33 +02:00
parent 6a1ce13ae2
commit b9dbac7b2c
12 changed files with 22 additions and 25 deletions

View File

@@ -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);
}

View File

@@ -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));

View File

@@ -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);
}

View File

@@ -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) {