From: Kai Moritz Date: Tue, 14 Jan 2020 07:10:47 +0000 (+0100) Subject: WIP:it X-Git-Tag: wip-it~20 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=4b1e91daec5783b7299600e972c94fc9a1517342;p=demos%2Ftesting WIP:it --- diff --git a/src/test/java/de/juplo/demo/DemoApplicationIT.java b/src/test/java/de/juplo/demo/DemoApplicationIT.java index 039b4b6..be40c75 100644 --- a/src/test/java/de/juplo/demo/DemoApplicationIT.java +++ b/src/test/java/de/juplo/demo/DemoApplicationIT.java @@ -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.AutoConfigureMockMvc; 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 -@AutoConfigureMockMvc class DemoApplicationIT extends IntegrationTestBase { - @Autowired MockMvc mockMvc; + @Autowired + WebApplicationContext context; + + + @BeforeEach + void setUp(WebApplicationContext context) + { + mockMvc = MockMvcBuilders.webAppContextSetup(context).build(); + } @Test