Skip to content

Commit 0ace484

Browse files
committed
chore: remove code smells in MainDefinitions
1 parent 176bae3 commit 0ace484

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/main/java/fr/insee/genesis/domain/service/surveyunit/SurveyUnitService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ public List<List<SurveyUnitModel>> findLatestByIdAndByQuestionnaireIdAndModeOrde
168168
.sorted((o1, o2) -> o2.getRecordDate().compareTo(o1.getRecordDate())) //Sorting update by date (latest updates first by date of upload in database)
169169
.toList();
170170

171-
List<SurveyUnitModel> LatestUpdates = extractLatestUpdates(allResponsesVersionsForSingleInterrId);
171+
List<SurveyUnitModel> latestUpdates = extractLatestUpdates(allResponsesVersionsForSingleInterrId);
172172

173173
//3) add to result (: keep same existing process)
174-
listLatestUpdatesbyVariables.add(LatestUpdates);
174+
listLatestUpdatesbyVariables.add(latestUpdates);
175175
});
176176

177177
return listLatestUpdatesbyVariables;

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package cucumber.functional_tests;
22

3-
import com.fasterxml.jackson.databind.ObjectMapper;
43
import cucumber.TestConstants;
54
import fr.insee.bpm.exceptions.MetadataParserException;
65
import fr.insee.bpm.metadata.model.VariablesMap;
@@ -328,12 +327,11 @@ public void check_external_variable_content_in_mongo(
328327
}
329328

330329
@Then("If we get latest states for {string} in collected variable {string}, survey unit {string} we should have {string} for iteration {int}")
331-
public void check_latest_state_collected(String questionnaireId, String variableName, String interrogationId, String expectedValue, int iteration) throws GenesisException, IOException {
330+
public void check_latest_state_collected(String questionnaireId, String variableName, String interrogationId, String expectedValue, int iteration) throws GenesisException {
332331
ResponseEntity<Object> response =
333332
responseController.findResponsesByInterrogationAndQuestionnaireLatestStates(interrogationId, questionnaireId);
334333
Assertions.assertThat(response.getStatusCode().value()).isEqualTo(200);
335334

336-
ObjectMapper objectMapper = new ObjectMapper().findAndRegisterModules();
337335
SurveyUnitQualityToolDto surveyUnitQualityToolDto = (SurveyUnitQualityToolDto) response.getBody();
338336

339337
List<VariableQualityToolDto> variableQualityToolDtos = surveyUnitQualityToolDto.getCollectedVariables().stream().filter(
@@ -353,7 +351,7 @@ public void check_latest_state_collected(String questionnaireId, String variable
353351
}
354352

355353
@Then("If we get latest states for {string} in external variable {string}, survey unit {string} we should have {string} for iteration {int}")
356-
public void check_latest_state_external(String questionnaireId, String variableName, String interrogationId, String expectedValue, int iteration) throws IOException, GenesisException {
354+
public void check_latest_state_external(String questionnaireId, String variableName, String interrogationId, String expectedValue, int iteration) throws GenesisException {
357355
ResponseEntity<Object> response =
358356
responseController.findResponsesByInterrogationAndQuestionnaireLatestStates(interrogationId, questionnaireId);
359357
Assertions.assertThat(response.getStatusCode().value()).isEqualTo(200);
@@ -435,7 +433,7 @@ public void check_su_latest_states_collected_variables_volumetry(String interrog
435433
@Then("The extracted survey unit latest states response should have a survey unit DTO has interrogationId " +
436434
"{string}" +
437435
" with {int} external variables")
438-
public void check_su_latest_states_external_variables_volumetry(String interrogationId, int expectedVolumetry) throws IOException {
436+
public void check_su_latest_states_external_variables_volumetry(String interrogationId, int expectedVolumetry) {
439437
Assertions.assertThat(surveyUnitLatestStatesResponse).isNotNull();
440438
Assertions.assertThat(surveyUnitLatestStatesResponse.getBody()).isNotNull();
441439
SurveyUnitQualityToolDto surveyUnitQualityToolDto = (SurveyUnitQualityToolDto) surveyUnitLatestStatesResponse.getBody();

0 commit comments

Comments
 (0)