use of eu.europa.ec.fisheries.ers.service.search.FishingTripId in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingTripDaoTest method testGetFishingTripIdsForMatchingFilterCriteria.
@Test
@SneakyThrows
public void testGetFishingTripIdsForMatchingFilterCriteria() throws Exception {
dbSetupTracker.skipNextLaunch();
Map<SearchFilter, String> searchCriteriaMap = new HashMap<>();
searchCriteriaMap.put(SearchFilter.ACTIVITY_TYPE, "DEPARTURE");
Map<SearchFilter, List<String>> searchCriteriaMapMultiVal = new HashMap<>();
List<String> purposeCodeValues = new ArrayList<>();
purposeCodeValues.add("9");
purposeCodeValues.add("1");
purposeCodeValues.add("5");
purposeCodeValues.add("3");
FishingActivityQuery query = new FishingActivityQuery();
query.setSearchCriteriaMap(searchCriteriaMap);
query.setSearchCriteriaMapMultipleValues(searchCriteriaMapMultiVal);
searchCriteriaMapMultiVal.put(SearchFilter.PURPOSE, purposeCodeValues);
Set<FishingTripId> fishingTripIdSet = dao.getFishingTripIdsForMatchingFilterCriteria(query);
FishingTripId fishingTripId = new FishingTripId("NOR-TRP-20160517234053706", "EU_TRIP_ID");
assertEquals(true, fishingTripIdSet.contains(fishingTripId));
assertNotNull(fishingTripIdSet);
}
use of eu.europa.ec.fisheries.ers.service.search.FishingTripId in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingTripDaoTest method testGetFishingTripIdsForMatchingFilterCriteria_noFilters.
@Test
@SneakyThrows
public void testGetFishingTripIdsForMatchingFilterCriteria_noFilters() throws Exception {
dbSetupTracker.skipNextLaunch();
Map<SearchFilter, String> searchCriteriaMap = new HashMap<>();
Map<SearchFilter, List<String>> searchCriteriaMapMultiVal = new HashMap<>();
List<String> purposeCodeValues = new ArrayList<>();
purposeCodeValues.add("9");
purposeCodeValues.add("1");
purposeCodeValues.add("5");
purposeCodeValues.add("3");
FishingActivityQuery query = new FishingActivityQuery();
query.setSearchCriteriaMap(searchCriteriaMap);
query.setSearchCriteriaMapMultipleValues(searchCriteriaMapMultiVal);
searchCriteriaMapMultiVal.put(SearchFilter.PURPOSE, purposeCodeValues);
Set<FishingTripId> fishingTripIdSet = dao.getFishingTripIdsForMatchingFilterCriteria(query);
FishingTripId fishingTripId = new FishingTripId("NOR-TRP-20160517234053706", "EU_TRIP_ID");
assertEquals(true, fishingTripIdSet.contains(fishingTripId));
assertNotNull(fishingTripIdSet);
}
Aggregations