use of eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingActivityViewMapperTest method testActivityJointFishingOperationViewMapper.
@Test
@SneakyThrows
public void testActivityJointFishingOperationViewMapper() {
FishingActivity fishingActivity = getFishingActivity();
FishingActivityEntity fishingActivityEntity = FishingActivityMapper.INSTANCE.mapToFishingActivityEntity(fishingActivity, null, new FishingActivityEntity());
fishingActivityEntity.setTypeCode("JOINT_FISHING_OPERATION");
fishingActivityEntity.getAllRelatedFishingActivities().iterator().next().setTypeCode("RELOCATION");
JointFishingOperationViewMapper mapper = new JointFishingOperationViewMapper();
FishingActivityViewDTO dto = mapper.mapFaEntityToFaDto(fishingActivityEntity);
assertNotNull(dto);
assertNotNull(dto.getActivityDetails());
assertNotNull(dto.getCatches());
assertNotNull(dto.getGears());
assertNotNull(dto.getGearProblems());
assertNotNull(dto.getVesselDetails());
assertNotNull(dto.getRelocations());
assertNotNull(dto.getProcessingProducts());
assertNotNull(dto.getLocations());
}
use of eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingActivityViewMapperTest method testActivityLandingViewMapper.
@Test
@SneakyThrows
public void testActivityLandingViewMapper() {
BaseActivityViewMapper mapperForView = ActivityViewMapperFactory.getMapperForView(ActivityViewEnum.LANDING);
FishingActivityEntity fishingActivityEntity = getFishingActivityEntity();
Set<FaCatchEntity> faCatches = generateFaCatches(fishingActivityEntity.getFaCatchs().iterator().next());
fishingActivityEntity.setFaCatchs(faCatches);
FishingActivityViewDTO fishingActivityViewDTO = mapperForView.mapFaEntityToFaDto(fishingActivityEntity);
assertNotNull(fishingActivityViewDTO.getActivityDetails());
assertNotNull(fishingActivityViewDTO.getReportDetails());
assertNull(ActivityArrivalViewMapper.INSTANCE.mapFaEntityToFaDto(null));
// printDtoOnConsole(fishingActivityViewDTO, FishingActivityView.Landing.class);
}
Aggregations