Add ClientResponse::createException

This commit adds the createException() method to ClientResponse,
returning a delayed WebClientResponseException based on the status code,
headers, and body as well as the corresponding request.

Closes gh-22825
This commit is contained in:
Arjen Poutsma
2019-07-11 15:42:57 +02:00
parent 5e9a22d118
commit b4207823af
7 changed files with 128 additions and 56 deletions

View File

@@ -69,7 +69,7 @@ public class DefaultClientResponseTests {
public void createMocks() {
mockResponse = mock(ClientHttpResponse.class);
mockExchangeStrategies = mock(ExchangeStrategies.class);
defaultClientResponse = new DefaultClientResponse(mockResponse, mockExchangeStrategies, "", "");
defaultClientResponse = new DefaultClientResponse(mockResponse, mockExchangeStrategies, "", "", () -> null);
}