WIP: WebClient
[facebook-errors] / src / test / java / de / juplo / facebook / errors / GraphApiExchangeFilterFunctionIntegrationTest.java
index ea41d27..2e3ae22 100644 (file)
@@ -11,6 +11,7 @@ import org.junit.Before;
 import org.junit.Test;
 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.WebClient;
 import reactor.core.publisher.Mono;
@@ -53,12 +54,9 @@ public class GraphApiExchangeFilterFunctionIntegrationTest
   @Test
   public void testValidError()
   {
-    LOG.info("testValidError");
-
-
     server
         .enqueue(new MockResponse()
-            .setStatus("400")
+            .setResponseCode(HttpStatus.BAD_REQUEST.value())
             .setHeader("Content-Type", "application/json")
             .setBody(
                 "{\n" +
@@ -89,6 +87,6 @@ public class GraphApiExchangeFilterFunctionIntegrationTest
           assertEquals("(#613) Calls to stream have exceeded the rate of 600 calls per 600 seconds.", e.getMessage());
           assertEquals(Type.OAuthException, e.getType());
         })
-        .verify(Duration.ofSeconds(3));
+        .verifyLater();
   }
 }