From a80f96b9c65eea47d68cd385552700649ddbf496 Mon Sep 17 00:00:00 2001 From: rabeaM Date: Thu, 14 Nov 2024 14:05:09 +0100 Subject: [PATCH] testing --- .../tests/ManagerControllerIT.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/java/org/highmed/numportal/integrationtesting/tests/ManagerControllerIT.java b/src/test/java/org/highmed/numportal/integrationtesting/tests/ManagerControllerIT.java index 5073e9fd..2a87259c 100644 --- a/src/test/java/org/highmed/numportal/integrationtesting/tests/ManagerControllerIT.java +++ b/src/test/java/org/highmed/numportal/integrationtesting/tests/ManagerControllerIT.java @@ -3,16 +3,23 @@ import com.fasterxml.jackson.databind.ObjectMapper; import lombok.SneakyThrows; import org.ehrbase.openehr.sdk.response.dto.QueryResponseData; + +import org.highmed.numportal.TestNumPortalApplication; import org.highmed.numportal.domain.dto.QueryDto; import org.highmed.numportal.integrationtesting.security.WithMockNumUser; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockserver.model.HttpRequest; import org.mockserver.model.HttpResponse; import org.mockserver.model.HttpStatusCode; import org.mockserver.model.StringBody; 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.http.MediaType; +import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.MvcResult; @@ -24,6 +31,12 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +@RunWith(SpringRunner.class) +@SpringBootTest( + webEnvironment = SpringBootTest.WebEnvironment.MOCK, + classes = TestNumPortalApplication.class) +@AutoConfigureMockMvc +@ActiveProfiles("itest") @TestPropertySource(properties = """ feature.search-with-aql = true """)