mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Update tests that use WebClient following changes to its API
This commit is contained in:
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…
Reference in New Issue
Block a user