Skip to content

Commit a1d8920

Browse files
committed
test: fixed unit tests
1 parent 5d96f67 commit a1d8920

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/test/java/cucumber/functional_tests/MainDefinitions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,15 @@ public void delete_directory() throws IOException {
191191

192192
@When("We extract survey unit data with questionnaireId {string} and interrogationId {string}")
193193
public void extract_survey_data(String questionnaireId, String interrogationId) {
194-
this.surveyUnitModelResponse = responseController.getLatestByInterrogation(interrogationId, questionnaireId);
194+
this.surveyUnitModelResponse = responseController.getLatestByInterrogation(interrogationId, questionnaireId.toUpperCase());
195195
}
196196

197197
@When("We extract survey unit latest states with questionnaireId {string} and interrogationId {string}")
198198
public void extract_survey_unit_latest_states(String questionnaireId, String interrogationId){
199199
try {
200200
this.surveyUnitLatestStatesResponse =
201201
responseController.findResponsesByInterrogationAndQuestionnaireLatestStates(interrogationId,
202-
questionnaireId);
202+
questionnaireId.toUpperCase());
203203
} catch (GenesisException e) {
204204
this.surveyUnitLatestStatesResponse = ResponseEntity.status(e.getStatus()).body(new ApiError(e.getMessage()));
205205
}
@@ -329,7 +329,7 @@ public void check_external_variable_content_in_mongo(
329329
@Then("If we get latest states for {string} in collected variable {string}, survey unit {string} we should have {string} for iteration {int}")
330330
public void check_latest_state_collected(String questionnaireId, String variableName, String interrogationId, String expectedValue, int iteration) throws GenesisException {
331331
ResponseEntity<Object> response =
332-
responseController.findResponsesByInterrogationAndQuestionnaireLatestStates(interrogationId, questionnaireId);
332+
responseController.findResponsesByInterrogationAndQuestionnaireLatestStates(interrogationId, questionnaireId.toUpperCase());
333333
Assertions.assertThat(response.getStatusCode().value()).isEqualTo(200);
334334

335335
SurveyUnitQualityToolDto surveyUnitQualityToolDto = (SurveyUnitQualityToolDto) response.getBody();
@@ -353,7 +353,7 @@ public void check_latest_state_collected(String questionnaireId, String variable
353353
@Then("If we get latest states for {string} in external variable {string}, survey unit {string} we should have {string} for iteration {int}")
354354
public void check_latest_state_external(String questionnaireId, String variableName, String interrogationId, String expectedValue, int iteration) throws GenesisException {
355355
ResponseEntity<Object> response =
356-
responseController.findResponsesByInterrogationAndQuestionnaireLatestStates(interrogationId, questionnaireId);
356+
responseController.findResponsesByInterrogationAndQuestionnaireLatestStates(interrogationId, questionnaireId.toUpperCase());
357357
Assertions.assertThat(response.getStatusCode().value()).isEqualTo(200);
358358
SurveyUnitQualityToolDto surveyUnitQualityToolDto = (SurveyUnitQualityToolDto) response.getBody();
359359

src/test/java/fr/insee/genesis/controller/adapter/LunaticXmlAdapterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void test02() {
234234
// When
235235
List<SurveyUnitModel> surveyUnitModels = LunaticXmlAdapter.convert(lunaticXmlSurveyUnit1, metadataModel.getVariables(), CAMPAIGN_ID, Mode.WEB);
236236
// Then
237-
Assertions.assertThat(surveyUnitModels.getFirst().getQuestionnaireId()).isEqualTo("questionnaireId1");
237+
Assertions.assertThat(surveyUnitModels.getFirst().getQuestionnaireId()).isEqualTo("questionnaireId1".toUpperCase());
238238
}
239239

240240
@Test

src/test/java/fr/insee/genesis/controller/rest/responses/RawResponseControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void saveJsonRawDataFromStringTest() throws Exception {
6161
//GIVEN
6262
lunaticJsonRawDataPersistanceStub.getMongoStub().clear();
6363
String campaignId = "SAMPLETEST-PARADATA-v1";
64-
String questionnaireId = "testIdQuest";
64+
String questionnaireId = "testIdQuest".toUpperCase();
6565
String interrogationId = "testinterrogationId";
6666
Map<String,Object> json = JsonUtils.jsonToMap("{\"COLLECTED\": {\"testdata\": {\"COLLECTED\": [\"test\"]}}}");
6767

src/test/java/fr/insee/genesis/controller/rest/responses/ResponseControllerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ResponseControllerTest {
5151
static final String DEFAULT_INTERROGATION_ID = "TESTINTERROGATIONID";
5252
static final String DEFAULT_QUESTIONNAIRE_ID = "TESTQUESTIONNAIREID";
5353
static final String CAMPAIGN_ID_WITH_DDI = "SAMPLETEST-PARADATA-v1";
54-
static final String QUESTIONNAIRE_ID_WITH_DDI = "SAMPLETEST-PARADATA-v1";
54+
static final String QUESTIONNAIRE_ID_WITH_DDI = "SAMPLETEST-PARADATA-v1".toUpperCase();
5555

5656
@BeforeAll
5757
static void init() {

0 commit comments

Comments
 (0)