|
|
@ -29,6 +29,7 @@ import java.nio.file.Files; |
|
|
|
import java.time.Duration; |
|
|
|
import java.time.Duration; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
import java.util.function.Consumer; |
|
|
|
import java.util.function.Consumer; |
|
|
|
import java.util.stream.Stream; |
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
|
|
@ -1080,6 +1081,24 @@ class WebClientIntegrationTests { |
|
|
|
.verify(Duration.ofSeconds(5)); |
|
|
|
.verify(Duration.ofSeconds(5)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ParameterizedWebClientTest |
|
|
|
|
|
|
|
void nullJsonResponseShouldBeReadAsEmpty(ClientHttpConnector connector) { |
|
|
|
|
|
|
|
startServer(connector); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prepareResponse(response -> response |
|
|
|
|
|
|
|
.setResponseCode(200) |
|
|
|
|
|
|
|
.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) |
|
|
|
|
|
|
|
.setBody("null")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Mono<Map> result = this.webClient.get() |
|
|
|
|
|
|
|
.uri("/null") |
|
|
|
|
|
|
|
.retrieve() |
|
|
|
|
|
|
|
.bodyToMono(Map.class); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StepVerifier.create(result) |
|
|
|
|
|
|
|
.verifyComplete(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void prepareResponse(Consumer<MockResponse> consumer) { |
|
|
|
private void prepareResponse(Consumer<MockResponse> consumer) { |
|
|
|
MockResponse response = new MockResponse(); |
|
|
|
MockResponse response = new MockResponse(); |
|
|
|