diff --git a/pom.xml b/pom.xml index 4174981..76720c0 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ - 43.0.0 + 43.2.0 2.4.0 gridsuite org.gridsuite:odre-server diff --git a/src/test/java/org/gridsuite/odre/server/OdreControllerTest.java b/src/test/java/org/gridsuite/odre/server/OdreControllerTest.java index b0563b0..6bb6309 100644 --- a/src/test/java/org/gridsuite/odre/server/OdreControllerTest.java +++ b/src/test/java/org/gridsuite/odre/server/OdreControllerTest.java @@ -8,14 +8,12 @@ import org.apache.commons.io.IOUtils; import org.gridsuite.odre.server.services.OdreService; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.mockito.MockitoAnnotations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.mock.web.MockMultipartFile; import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.test.web.servlet.MockMvc; import org.springframework.util.ResourceUtils; @@ -37,14 +35,9 @@ class OdreControllerTest { @Autowired private MockMvc mvc; - @MockBean + @MockitoBean private OdreService odreService; - @BeforeEach - void setUp() { - MockitoAnnotations.initMocks(this); - } - @Test void test() throws Exception { byte[] aerialLinesBytes = IOUtils.toByteArray(new FileInputStream(ResourceUtils.getFile("classpath:lignes-aeriennes-rte.csv"))); diff --git a/src/test/java/org/gridsuite/odre/server/client/OdreClientImplTest.java b/src/test/java/org/gridsuite/odre/server/client/OdreClientImplTest.java index c567084..e97600e 100644 --- a/src/test/java/org/gridsuite/odre/server/client/OdreClientImplTest.java +++ b/src/test/java/org/gridsuite/odre/server/client/OdreClientImplTest.java @@ -15,12 +15,12 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.mock.web.MockMultipartFile; +import org.springframework.test.context.bean.override.mockito.MockitoBean; import org.springframework.util.ResourceUtils; import org.springframework.web.client.RestTemplate; @@ -40,7 +40,7 @@ @SpringBootTest class OdreClientImplTest { - @MockBean + @MockitoBean private RestTemplate openDataRest; @BeforeEach