From 37c1cea0bcfb6f7233cbc50d5c87e3257ba95245 Mon Sep 17 00:00:00 2001
From: Betty Becuwe <77614323+BettyB979@users.noreply.github.com>
Date: Tue, 26 Mar 2024 16:19:42 +0100
Subject: [PATCH] Update pom.xml (#56)
* Update pom.xml
* Update SurveyControllerTest.java
* Update MoogControllerTest.java
---
pom.xml | 3 +-
.../controller/SurveyControllerTest.java | 32 ++++++++-----------
.../query/controller/MoogControllerTest.java | 7 ++--
3 files changed, 19 insertions(+), 23 deletions(-)
diff --git a/pom.xml b/pom.xml
index 511dd43d..9b2349ac 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
fr.insee.survey
platine-management
- 1.0.29
+ 1.0.30
platine-management
REST API for communication between DB and Platine-Management UI and Platine-My-Surveys UI
@@ -69,6 +69,7 @@
org.postgresql
postgresql
+ 42.3.9
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyControllerTest.java b/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyControllerTest.java
index 4ded9794..7b15a2e0 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyControllerTest.java
+++ b/src/test/java/fr/insee/survey/datacollectionmanagement/metadata/controller/SurveyControllerTest.java
@@ -1,20 +1,11 @@
package fr.insee.survey.datacollectionmanagement.metadata.controller;
-import static org.junit.Assert.assertTrue;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
-import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-
-import java.util.Optional;
-
+import fr.insee.survey.datacollectionmanagement.constants.Constants;
+import fr.insee.survey.datacollectionmanagement.metadata.domain.Survey;
+import fr.insee.survey.datacollectionmanagement.metadata.repository.SurveyRepository;
+import fr.insee.survey.datacollectionmanagement.metadata.service.SurveyService;
import org.json.JSONException;
import org.json.JSONObject;
-import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
@@ -26,10 +17,15 @@
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.MockMvc;
-import fr.insee.survey.datacollectionmanagement.constants.Constants;
-import fr.insee.survey.datacollectionmanagement.metadata.domain.Survey;
-import fr.insee.survey.datacollectionmanagement.metadata.repository.SurveyRepository;
-import fr.insee.survey.datacollectionmanagement.metadata.service.SurveyService;
+import java.util.Optional;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
+import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@AutoConfigureMockMvc
@SpringBootTest
@@ -48,7 +44,7 @@ public class SurveyControllerTest {
@DirtiesContext(methodMode = MethodMode.BEFORE_METHOD)
@Test
public void getSurveyOk() throws Exception {
- String identifier = "SOURCE12022";
+ String identifier = "SOURCE12023";
Optional survey = surveyService.findById(identifier);
assertTrue(survey.isPresent());
String json = createJson(survey.get(), "SOURCE1");
diff --git a/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogControllerTest.java b/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogControllerTest.java
index e7ee0336..daa0052e 100644
--- a/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogControllerTest.java
+++ b/src/test/java/fr/insee/survey/datacollectionmanagement/query/controller/MoogControllerTest.java
@@ -1,14 +1,12 @@
package fr.insee.survey.datacollectionmanagement.query.controller;
import fr.insee.survey.datacollectionmanagement.constants.Constants;
-import fr.insee.survey.datacollectionmanagement.query.service.CheckHabilitationService;
import fr.insee.survey.datacollectionmanagement.query.service.MoogService;
-import fr.insee.survey.datacollectionmanagement.questioning.domain.SurveyUnit;
import org.junit.jupiter.api.Test;
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.boot.test.mock.mockito.MockBean;
+import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.MockMvc;
@@ -19,6 +17,7 @@
@AutoConfigureMockMvc
@SpringBootTest
+@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD)
@ActiveProfiles("test")
public class MoogControllerTest {
@@ -30,7 +29,7 @@ public class MoogControllerTest {
@Test
public void getMoogReadOnlyUrl() throws Exception {
- String idCampaign= "SOURCE12023T01";
+ String idCampaign= "SOURCE12024T01";
String surveyUnitId= "100000000";
this.mockMvc.perform(get(Constants.MOOG_API_READONLY_URL, idCampaign,surveyUnitId)).andDo(print()).andExpect(status().isOk())
.andExpect(content().string("http://localhost:8081/readonly/questionnaire/m0/unite-enquetee/100000000"));