3 import de.juplo.integrationtest.IntegrationtestApplicationIT.Application;
5 import org.junit.jupiter.api.Test;
6 import static org.mockserver.matchers.Times.exactly;
7 import static org.mockserver.model.HttpForward.forward;
8 import static org.mockserver.model.HttpRequest.request;
9 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.boot.autoconfigure.SpringBootApplication;
11 import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc;
12 import org.springframework.boot.test.context.SpringBootTest;
13 import org.springframework.context.annotation.Bean;
14 import org.springframework.test.web.servlet.MockMvc;
15 import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
16 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
18 @SpringBootTest(classes = Application.class)
20 class IntegrationtestApplicationIT extends IntegrationTestBase {
27 void contextLoads() throws Exception {
29 .when(request().withPath("/?path=test.txt"), exactly(1))
30 .forward(forward().withHost(getNginxIP()).withPort(getNginxPort()));
32 .perform(get(URI.create("http://sut/?path=test.txt")))
33 .andExpect(status().isOk());
36 @SpringBootApplication
37 static class Application {
40 public RemoteContentController remoteContentController()
42 return new RemoteContentController(
44 IntegrationtestApplicationIT.MOCK_SERVER.getLocalPort()