Update tests that use WebClient following changes to its API

pull/8785/head
Andy Wilkinson 8 years ago
parent bf83e74d5f
commit 99aa155412

@ -91,14 +91,14 @@ public abstract class AbstractReactiveWebServerFactoryTests {
assertThat(this.output.toString()).contains("started on port");
Mono<String> result = getWebClient().post().uri("/test")
.contentType(MediaType.TEXT_PLAIN)
.exchange(BodyInserters.fromObject("Hello World"))
.body(BodyInserters.fromObject("Hello World")).exchange()
.then(response -> response.bodyToMono(String.class));
assertThat(result.block()).isEqualTo("Hello World");
this.webServer.stop();
Mono<ClientResponse> response = getWebClient().post().uri("/test")
.contentType(MediaType.TEXT_PLAIN)
.exchange(BodyInserters.fromObject("Hello World"));
.body(BodyInserters.fromObject("Hello World")).exchange();
StepVerifier.create(response).expectError().verify();
}
@ -112,7 +112,7 @@ public abstract class AbstractReactiveWebServerFactoryTests {
Mono<String> result = WebClient.create("http://localhost:" + specificPort).post()
.uri("/test").contentType(MediaType.TEXT_PLAIN)
.exchange(BodyInserters.fromObject("Hello World"))
.body(BodyInserters.fromObject("Hello World")).exchange()
.then(response -> response.bodyToMono(String.class));
assertThat(result.block()).isEqualTo("Hello World");

Loading…
Cancel
Save