Search in sources :

Example 11 with FishingActivityViewDTO

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());
}
Also used : MapperUtil.getFishingActivity(eu.europa.ec.fisheries.ers.service.util.MapperUtil.getFishingActivity) FishingActivity(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity) FishingActivityViewDTO(eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO) JointFishingOperationViewMapper(eu.europa.ec.fisheries.ers.service.mapper.view.JointFishingOperationViewMapper) FishingActivityEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity) Test(org.junit.Test) SneakyThrows(lombok.SneakyThrows)

Example 12 with FishingActivityViewDTO

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);
}
Also used : FaCatchEntity(eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity) BaseActivityViewMapper(eu.europa.ec.fisheries.ers.service.mapper.view.base.BaseActivityViewMapper) FishingActivityViewDTO(eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO) FishingActivityEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity) Test(org.junit.Test) SneakyThrows(lombok.SneakyThrows)

Aggregations

FishingActivityViewDTO (eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO)12 FishingActivityEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)5 SneakyThrows (lombok.SneakyThrows)5 Test (org.junit.Test)5 ActivityDetailsDto (eu.europa.ec.fisheries.ers.service.dto.view.ActivityDetailsDto)4 BaseActivityViewMapper (eu.europa.ec.fisheries.ers.service.mapper.view.base.BaseActivityViewMapper)4 FaCatchEntity (eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity)3 FishingActivityIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityIdentifierEntity)2 Geometry (com.vividsolutions.jts.geom.Geometry)1 VesselDetailsDTO (eu.europa.ec.fisheries.ers.service.dto.fareport.details.VesselDetailsDTO)1 FluxLocationDto (eu.europa.ec.fisheries.ers.service.dto.view.FluxLocationDto)1 JointFishingOperationViewMapper (eu.europa.ec.fisheries.ers.service.mapper.view.JointFishingOperationViewMapper)1 MapperUtil.getFishingActivity (eu.europa.ec.fisheries.ers.service.util.MapperUtil.getFishingActivity)1 ServiceException (eu.europa.ec.fisheries.uvms.commons.service.exception.ServiceException)1 FishingActivity (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity)1