WIP:it
authorKai Moritz <kai@juplo.de>
Tue, 14 Jan 2020 07:32:55 +0000 (08:32 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 14 Jan 2020 07:32:55 +0000 (08:32 +0100)
src/test/java/de/juplo/demo/DemoApplicationIT.java

index ef9153a..be40c75 100644 (file)
@@ -1,12 +1,12 @@
 package de.juplo.demo;
 
 import java.net.URI;
+import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 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.servlet.AutoConfigureWebMvc;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -15,14 +15,23 @@ import org.springframework.test.web.servlet.MockMvc;
 import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+import org.springframework.test.web.servlet.setup.MockMvcBuilders;
+import org.springframework.web.context.WebApplicationContext;
 import org.springframework.web.reactive.function.client.WebClient;
 
 @SpringBootTest
-@AutoConfigureWebMvc
 class DemoApplicationIT extends IntegrationTestBase
 {
-  @Autowired
   MockMvc mockMvc;
+  @Autowired
+  WebApplicationContext context;
+
+
+  @BeforeEach
+  void setUp(WebApplicationContext context)
+  {
+    mockMvc = MockMvcBuilders.webAppContextSetup(context).build();
+  }
 
 
   @Test