Search in sources :

Example 21 with FishingActivity

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity 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 22 with FishingActivity

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getFaReportDocument.

public static FAReportDocument getFaReportDocument() {
    CodeType typeCode = getCodeType("DECLARATION", "FLUX_FA_REPORT_TYPE");
    CodeType fmcMarkerCode = getCodeType("Fmz marker 1", "h49rh-fhrus33-fj84hjs82-4h84hw82");
    List<IDType> relatedReportIDs = Arrays.asList(getIdType("ID 1", "47rfh-5hry4-thfur75-4hf743"));
    DateTimeType acceptanceDateTime = getDateTimeType("2016-07-01 11:15:00");
    FLUXReportDocument relatedFLUXReportDocument = getFluxReportDocument();
    List<FishingActivity> specifiedFishingActivities = Arrays.asList(getFishingActivity());
    VesselTransportMeans specifiedVesselTransportMeans = getVesselTransportMeans();
    FAReportDocument faReportDocument = new FAReportDocument(typeCode, fmcMarkerCode, relatedReportIDs, acceptanceDateTime, relatedFLUXReportDocument, specifiedFishingActivities, specifiedVesselTransportMeans);
    return faReportDocument;
}
Also used : FLUXReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXReportDocument) FishingActivity(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) FAReportDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument) VesselTransportMeans(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans)

Aggregations

FishingActivity (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity)9 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)7 FishingActivityEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityEntity)5 VesselTransportMeans (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans)4 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)4 HashSet (java.util.HashSet)3 VesselStorageCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselStorageCharacteristic)3 FluxCharacteristicEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxCharacteristicEntity)2 BigDecimal (java.math.BigDecimal)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 DelimitedPeriod (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod)2 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)2 FishingTrip (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip)2 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)2 MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)2 QuantityType (un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType)2 DelimitedPeriodEntity (eu.europa.ec.fisheries.ers.fa.entities.DelimitedPeriodEntity)1 FaCatchEntity (eu.europa.ec.fisheries.ers.fa.entities.FaCatchEntity)1 FishingActivityIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingActivityIdentifierEntity)1