WIP:itflux ALTERNATIVE FIX
authorKai Moritz <kai@juplo.de>
Tue, 14 Jan 2020 08:26:45 +0000 (09:26 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 14 Jan 2020 08:54:13 +0000 (09:54 +0100)
src/test/java/de/juplo/demo/DemoApplicationIT.java

index 1c628c4..674efc8 100644 (file)
@@ -1,22 +1,21 @@
 package de.juplo.demo;
 
-import java.net.URI;
 import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.extension.ExtendWith;
 import static org.mockserver.matchers.Times.exactly;
 import static org.mockserver.model.HttpForward.forward;
 import static org.mockserver.model.HttpRequest.request;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.MediaType;
-import org.springframework.test.context.junit.jupiter.SpringExtension;
 import org.springframework.test.web.reactive.server.WebTestClient;
 import org.springframework.web.reactive.function.client.WebClient;
 
-@ExtendWith(SpringExtension.class)
-@WebFluxTest
+@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+@EnableAutoConfiguration
 class DemoApplicationIT extends IntegrationTestBase
 {
   @Autowired
@@ -33,7 +32,7 @@ class DemoApplicationIT extends IntegrationTestBase
             .withPort(NGINX.getMappedPort(80)));
     webClient
         .get()
-        .uri(URI.create("http://S.U.T/?path=test.txt"))
+        .uri("/?path=test.txt")
         .exchange()
         .expectStatus().isOk()
         .expectHeader().contentType(MediaType.TEXT_HTML)