use of eu.europa.ec.fisheries.uvms.activity.model.schemas.FishingActivityForTripIds in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityServiceBean method getFaAndTripIdsFromTripIds.
@Override
public GetFishingActivitiesForTripResponse getFaAndTripIdsFromTripIds(List<FishingActivityForTripIds> faAndTripIds) throws ServiceException {
GetFishingActivitiesForTripResponse response = new GetFishingActivitiesForTripResponse();
List<FaIdsListWithTripIdMap> responseList = new ArrayList<>();
response.setFaWithIdentifiers(responseList);
for (FishingActivityForTripIds faTripId : faAndTripIds) {
List<FishingActivityEntity> fishingActivies = fishingActivityDao.getFishingActivityForTrip(faTripId.getTripId(), faTripId.getTripSchemeId(), faTripId.getFishActTypeCode(), faTripId.getFluxRepDocPurposeCodes());
for (FishingActivityEntity faEntity : fishingActivies) {
addToIdsList(responseList, faEntity);
}
}
return response;
}
use of eu.europa.ec.fisheries.uvms.activity.model.schemas.FishingActivityForTripIds in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityServiceBeanTest method testGetFaAndTripIdsResponse.
@Test
@SneakyThrows
public void testGetFaAndTripIdsResponse() {
List<String> flRepPurpCodes = new ArrayList<String>() {
{
add("1");
add("9");
}
};
when(fishingActivityDao.getFishingActivityForTrip(any(String.class), any(String.class), any(String.class), any(flRepPurpCodes.getClass()))).thenReturn(mockFishActEntities());
GetFishingActivitiesForTripResponse response = activityService.getFaAndTripIdsFromTripIds(Arrays.asList(new FishingActivityForTripIds("faTypeCode", "tripId", "tripSchemeId", flRepPurpCodes)));
assertNotNull(response);
assertTrue(CollectionUtils.isNotEmpty(response.getFaWithIdentifiers()));
}
Aggregations