Skip to content

Commit

Permalink
refactor: resolve sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
davdarras committed Jul 19, 2024
1 parent f5c207c commit dcf9fd8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
public class DummyController {

@PreAuthorize(AuthorityPrivileges.HAS_USER_PRIVILEGES)
public void testMethodHasUserPrivileges() {}
public void testMethodHasUserPrivileges() {
// used to verify ACL
}

@PreAuthorize(AuthorityPrivileges.HAS_INTERVIEWER_PRIVILEGES + "||" + AuthorityPrivileges.HAS_ADMIN_PRIVILEGES )
public void testMethodMultiplePrivileges() {}
public void testMethodMultiplePrivileges() {
// used to verify ACL
}

public void testMethodNoPreauthorize() {}
public void testMethodNoPreauthorize() {
// used to verify ACL
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ void testGetInterviewerCampaigns01() {
List<CampaignSummaryDto> campaigns = interviewerController.getInterviewerCampaignList("userId");
assertThat(pilotageComponent.isWentThroughInterviewerCampaigns()).isTrue();
assertThat(campaigns).hasSize(2);
assertThat(campaigns.get(0).getId()).isEqualTo(PilotageFakeComponent.CAMPAIGN1_ID);
assertThat(campaigns.getFirst().getId()).isEqualTo(PilotageFakeComponent.CAMPAIGN1_ID);
}

@Test
@DisplayName("On retrieving survey units for a campaign, then return survey units from pilotage service")
void testGetSurveyUnitsCampaign01() {
List<SurveyUnitByCampaignDto> surveyUnits = interviewerController.getListSurveyUnitByCampaign("campaign-id");
assertThat(surveyUnits).hasSize(2);
assertThat(surveyUnits.get(0).id()).isEqualTo(PilotageFakeComponent.SURVEY_UNIT1_ID);
assertThat(surveyUnits.getFirst().id()).isEqualTo(PilotageFakeComponent.SURVEY_UNIT1_ID);
}

@Test
Expand All @@ -57,13 +57,4 @@ void testGetSurveyUnitsForInterviewers03() {
assertThat(surveyUnits.get(0).id()).isEqualTo(PilotageFakeComponent.SURVEY_UNIT1_ID);
assertThat(surveyUnits.get(1).id()).isEqualTo(PilotageFakeComponent.SURVEY_UNIT2_ID);
}

@Test
@DisplayName("On retrieving survey units for an interviewer, return survey units found")
void testGetSurveyUnitsForInterviewers04() {
List<SurveyUnitDto> surveyUnits = interviewerController.getInterviewerSurveyUnits();
assertThat(surveyUnits).size().isEqualTo(2);
assertThat(surveyUnits.get(0).id()).isEqualTo(PilotageFakeComponent.SURVEY_UNIT1_ID);
assertThat(surveyUnits.get(1).id()).isEqualTo(PilotageFakeComponent.SURVEY_UNIT2_ID);
}
}
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public class JsonTestHelper {

private final static String DATA_FOLDER = "data/";
private static final String DATA_FOLDER = "data/";

public JsonTestHelper() {
throw new IllegalArgumentException("Utility class");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void throwExceptionIfCampaignAlreadyExist(String campaignId) {

@Override
public void throwExceptionIfCampaignNotLinkedToQuestionnaire(String campaignId, String questionnaireId) {

// not implemented yet
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void save(String surveyUnitId, StateData stateData) {

@Override
public void create(String surveyUnitId, StateData stateData) {

// not implemented yet
}

@Override
Expand Down

0 comments on commit dcf9fd8

Please sign in to comment.