use of eu.europa.ec.fisheries.uvms.spatial.model.schemas.AreaIdentifierType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityServiceBeanTest method getFishingActivityListByQuery_emptyResultSet.
@Test
@SneakyThrows
public void getFishingActivityListByQuery_emptyResultSet() throws ServiceException {
FishingActivityQuery query = new FishingActivityQuery();
Map<SearchFilter, String> searchCriteriaMap = new HashMap<>();
List<AreaIdentifierType> areaIdentifierTypes = new ArrayList<>();
searchCriteriaMap.put(SearchFilter.OWNER, "OWNER1");
Map<SearchFilter, List<String>> searchCriteriaMapMultipleValue = new HashMap<>();
List<String> purposeCodeList = new ArrayList<>();
purposeCodeList.add("9");
searchCriteriaMapMultipleValue.put(SearchFilter.PURPOSE, purposeCodeList);
PaginationDto pagination = new PaginationDto();
pagination.setPageSize(4);
pagination.setOffset(1);
query.setPagination(pagination);
query.setSearchCriteriaMap(searchCriteriaMap);
query.setSearchCriteriaMapMultipleValues(searchCriteriaMapMultipleValue);
when(spatialModule.getFilteredAreaGeom(areaIdentifierTypes)).thenReturn("('MULTIPOINT (10 40, 40 30, 20 20, 30 10)')");
when(fishingActivityDao.getFishingActivityListByQuery(query)).thenReturn(new ArrayList<FishingActivityEntity>());
// Trigger
FilterFishingActivityReportResultDTO filterFishingActivityReportResultDTO = activityService.getFishingActivityListByQuery(query, new ArrayList<Dataset>());
Mockito.verify(fishingActivityDao, Mockito.times(1)).getFishingActivityListByQuery(Mockito.any(FishingActivityQuery.class));
// Verify
assertNotNull(filterFishingActivityReportResultDTO);
}
Aggregations