Search in sources :

Example 1 with JointFishingOperationViewMapper

use of eu.europa.ec.fisheries.ers.service.mapper.view.JointFishingOperationViewMapper 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)

Aggregations

FishingActivityEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)1 FishingActivityViewDTO (eu.europa.ec.fisheries.ers.service.dto.view.parent.FishingActivityViewDTO)1 JointFishingOperationViewMapper (eu.europa.ec.fisheries.ers.service.mapper.view.JointFishingOperationViewMapper)1 MapperUtil.getFishingActivity (eu.europa.ec.fisheries.ers.service.util.MapperUtil.getFishingActivity)1 SneakyThrows (lombok.SneakyThrows)1 Test (org.junit.Test)1 FishingActivity (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity)1