From 2b59b561e9f491ce7a41b8002e221e0a7bac8848 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Thu, 21 Nov 2019 17:12:18 +0100 Subject: [PATCH] WIP: WebClient --- .../GraphApiExchangeFilterFunctionIntegrationTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/de/juplo/facebook/errors/GraphApiExchangeFilterFunctionIntegrationTest.java b/src/test/java/de/juplo/facebook/errors/GraphApiExchangeFilterFunctionIntegrationTest.java index b90e057..4e07259 100644 --- a/src/test/java/de/juplo/facebook/errors/GraphApiExchangeFilterFunctionIntegrationTest.java +++ b/src/test/java/de/juplo/facebook/errors/GraphApiExchangeFilterFunctionIntegrationTest.java @@ -14,7 +14,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.http.client.reactive.JettyClientHttpConnector; -import org.springframework.web.reactive.function.client.ExchangeFilterFunction; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -42,7 +41,6 @@ public class GraphApiExchangeFilterFunctionIntegrationTest .builder() .clientConnector(new JettyClientHttpConnector()) .baseUrl(server.url("/").toString()) - .filter(GraphApiExchangeFilterFunction.INSTANCE) .build(); } @@ -76,6 +74,7 @@ public class GraphApiExchangeFilterFunctionIntegrationTest .get() .uri("/egal") .retrieve() + .onStatus(status -> status.is4xxClientError(), response -> GraphApiException.create(response)) .bodyToMono(String.class); StepVerifier @@ -110,7 +109,7 @@ public class GraphApiExchangeFilterFunctionIntegrationTest server .enqueue(new MockResponse() - .setResponseCode(200) + .setResponseCode(400) .setHeader("Content-Type", "text/plain") .setBody("Hello Spring!")); @@ -119,6 +118,7 @@ public class GraphApiExchangeFilterFunctionIntegrationTest result = webClient.get() .uri("/greeting?name=Spring") .retrieve() + .onStatus(status -> status.is4xxClientError(), response -> GraphApiException.create(response)) .bodyToMono(String.class); StepVerifier.create(result) -- 2.20.1