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:
@@ -19,7 +19,6 @@ import java.net.URI;
|
||||
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -64,7 +63,7 @@ public class JsonContentTests {
|
||||
public void postJsonContent() throws Exception {
|
||||
this.client.post().uri("/persons")
|
||||
.contentType(MediaType.APPLICATION_JSON_UTF8)
|
||||
.body("{\"name\":\"John\"}")
|
||||
.syncBody("{\"name\":\"John\"}")
|
||||
.exchange()
|
||||
.expectStatus().isCreated()
|
||||
.expectBody().isEmpty();
|
||||
|
||||
@@ -123,7 +123,7 @@ public class ResponseEntityTests {
|
||||
@Test
|
||||
public void postEntity() throws Exception {
|
||||
this.client.post().uri("/persons")
|
||||
.body(new Person("John"))
|
||||
.syncBody(new Person("John"))
|
||||
.exchange()
|
||||
.expectStatus().isCreated()
|
||||
.expectHeader().valueEquals("location", "/persons/John")
|
||||
|
||||
Reference in New Issue
Block a user