use of eu.europa.ec.fisheries.ers.service.dto.fareport.summary.FACatchDetailsDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class FaCatchReportServiceBeanTest method testGetCatchesTableForCatchDetailsScreen.
@Test
@SneakyThrows
public void testGetCatchesTableForCatchDetailsScreen() throws ServiceException {
FishingActivityQuery query = new FishingActivityQuery();
List<GroupCriteria> groupByFields = new ArrayList<>();
groupByFields.add(GroupCriteria.DATE_DAY);
groupByFields.add(GroupCriteria.FAO_AREA);
groupByFields.add(GroupCriteria.TERRITORY);
groupByFields.add(GroupCriteria.EFFORT_ZONE);
groupByFields.add(GroupCriteria.GFCM_GSA);
groupByFields.add(GroupCriteria.GFCM_STAT_RECTANGLE);
groupByFields.add(GroupCriteria.ICES_STAT_RECTANGLE);
groupByFields.add(GroupCriteria.RFMO);
groupByFields.add(GroupCriteria.SPECIES);
query.setGroupByFields(groupByFields);
Map<SearchFilter, String> searchCriteriaMap = new EnumMap<SearchFilter, String>(SearchFilter.class);
searchCriteriaMap.put(SearchFilter.TRIP_ID, "NOR-TRP-20160517234053706");
query.setSearchCriteriaMap(searchCriteriaMap);
when(faCatchDao.getGroupedFaCatchData(query, Boolean.FALSE)).thenReturn(MapperUtil.getGroupedFaCatchSummaryCustomEntityData());
when(faCatchDao.getGroupedFaCatchData(query, Boolean.TRUE)).thenReturn(MapperUtil.getGroupedFaCatchSummaryCustomEntityData());
// when(vesselIdentifiersDao.getLatestVesselIdByTrip("NOR-TRP-20160517234053706")).thenReturn(MapperUtil.getVesselIdentifiersList());
// Trigger
FACatchDetailsDTO faCatchDetailsDTO = faCatchReportService.getCatchDetailsScreen("NOR-TRP-20160517234053706");
Mockito.verify(faCatchDao, Mockito.times(2)).getGroupedFaCatchData(Mockito.any(FishingActivityQuery.class), Mockito.any(Boolean.class));
// Verify
assertNotNull(faCatchDetailsDTO);
}
use of eu.europa.ec.fisheries.ers.service.dto.fareport.summary.FACatchDetailsDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class FaCatchReportServiceBean method getCatchDetailsScreen.
/**
* This method gets DTO representing catch details screen. It will hve 2 summary tables for catches and landing
* @param tripId data for this trip should be returned
* @return
* @throws ServiceException
*/
@Override
public FACatchDetailsDTO getCatchDetailsScreen(String tripId) throws ServiceException {
FACatchDetailsDTO faCatchDetailsDTO = new FACatchDetailsDTO();
faCatchDetailsDTO.setCatches(getCatchDetailsScreenTable(tripId, false));
faCatchDetailsDTO.setLanding(getCatchDetailsScreenTable(tripId, true));
return faCatchDetailsDTO;
}
Aggregations