use of eu.europa.ec.fisheries.uvms.activity.model.schemas.FishingTripResponse in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingTripServiceBeanTest method testFilterFishingTrips.
@Test
@SneakyThrows
public void testFilterFishingTrips() throws ServiceException, JsonProcessingException {
Map<SearchFilter, String> searchMap = new HashMap<>();
searchMap.put(SearchFilter.REPORT_TYPE, "NOTIFICATION");
searchMap.put(SearchFilter.PERIOD_START, "2012-05-27T07:47:31");
searchMap.put(SearchFilter.PERIOD_END, "2017-05-27T07:47:31");
Map<SearchFilter, List<String>> searchCriteriaMapMultiVal = new HashMap<>();
List<String> activityTypeValues = new ArrayList<>();
activityTypeValues.add("FISHING_OPERATION");
activityTypeValues.add("DEPARTURE");
searchCriteriaMapMultiVal.put(SearchFilter.ACTIVITY_TYPE, activityTypeValues);
FishingActivityQuery query = new FishingActivityQuery();
query.setSearchCriteriaMap(searchMap);
query.setSearchCriteriaMapMultipleValues(searchCriteriaMapMultiVal);
when(fishingTripDao.getFishingTripIdsForMatchingFilterCriteria(any(FishingActivityQuery.class))).thenReturn(MapperUtil.getFishingTripIdSet());
when(fishingTripDao.getCountOfFishingTripsForMatchingFilterCriteria(any(FishingActivityQuery.class))).thenReturn(new Integer(2));
when(fishingActivityDao.getFishingActivityListByQuery(any(FishingActivityQuery.class))).thenReturn(MapperUtil.getFishingActivityEntityList());
// Trigger
FishingTripResponse response = fishingTripService.filterFishingTrips(query);
assertNotNull(response);
}
Aggregations