Skip to content

Commit

Permalink
#13250 Create Survey data structure - fixed api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Levente Gal committed Jan 30, 2025
1 parent 64fd978 commit ac1bf53
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

package de.symeda.sormas.backend.survey;

import static org.apache.commons.collections4.CollectionUtils.isNotEmpty;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
Expand All @@ -35,8 +37,6 @@
import javax.persistence.criteria.Selection;
import javax.validation.Valid;

import org.apache.commons.collections4.CollectionUtils;

import de.symeda.sormas.api.survey.SurveyCriteria;
import de.symeda.sormas.api.survey.SurveyDto;
import de.symeda.sormas.api.survey.SurveyFacade;
Expand Down Expand Up @@ -128,7 +128,7 @@ private List<Selection<?>> sortBy(List<SortProperty> sortProperties, Root<Survey

List<Selection<?>> selections = new ArrayList<>();

if (CollectionUtils.isNotEmpty(sortProperties)) {
if (isNotEmpty(sortProperties)) {
List<Order> order = new ArrayList<>(sortProperties.size());
for (SortProperty sortProperty : sortProperties) {
CriteriaBuilderHelper.OrderBuilder orderBuilder = CriteriaBuilderHelper.createOrderBuilder(cb, sortProperty.ascending);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

package de.symeda.sormas.backend.survey;

import static org.apache.commons.collections4.CollectionUtils.isNotEmpty;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
Expand All @@ -35,8 +37,6 @@
import javax.persistence.criteria.Selection;
import javax.validation.Valid;

import org.apache.commons.collections.CollectionUtils;

import de.symeda.sormas.api.survey.SurveyTokenCriteria;
import de.symeda.sormas.api.survey.SurveyTokenDto;
import de.symeda.sormas.api.survey.SurveyTokenFacade;
Expand Down Expand Up @@ -143,6 +143,7 @@ public List<SurveyTokenIndexDto> getIndexList(SurveyTokenCriteria criteria, Inte
}

@Override
@RightsAllowed(UserRight._SURVEY_TOKEN_DELETE)
public void deletePermanent(String uuid) {
surveyTokenService.deletePermanent(surveyTokenService.getByUuid(uuid));
}
Expand All @@ -151,7 +152,7 @@ private List<Selection<?>> sortBy(List<SortProperty> sortProperties, Root<Survey

List<Selection<?>> selections = new ArrayList<>();

if (CollectionUtils.isNotEmpty(sortProperties)) {
if (isNotEmpty(sortProperties)) {
List<Order> order = new ArrayList<>(sortProperties.size());
for (SortProperty sortProperty : sortProperties) {
CriteriaBuilderHelper.OrderBuilder orderBuilder = CriteriaBuilderHelper.createOrderBuilder(cb, sortProperty.ascending);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import de.symeda.sormas.backend.immunization.entity.DirectoryImmunization;
import de.symeda.sormas.backend.manualmessagelog.ManualMessageLog;
import de.symeda.sormas.backend.selfreport.SelfReport;
import de.symeda.sormas.backend.survey.Survey;
import de.symeda.sormas.backend.survey.SurveyToken;
import de.symeda.sormas.backend.systemevent.SystemEvent;
import de.symeda.sormas.backend.user.UserReference;
import de.symeda.sormas.backend.vaccination.FirstVaccinationDate;
Expand Down Expand Up @@ -72,7 +74,9 @@ public void testGetConfigFullyDefined() {
Aefi.class,
AdverseEvents.class,
AefiInvestigation.class,
DocumentTemplate.class);
DocumentTemplate.class,
Survey.class,
SurveyToken.class);

@Test
public void test_all_entities_have_export_configuration() {
Expand Down

0 comments on commit ac1bf53

Please sign in to comment.