Search in sources :

Example 11 with VesselTransportMeans

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

the class VesselTransportMeansMapperTest method testVesselTransportMeansMapper.

@Test
public void testVesselTransportMeansMapper() {
    VesselTransportMeans vesselTransportMeans = MapperUtil.getVesselTransportMeans();
    VesselTransportMeansEntity vesselTransportMeansEntity = VesselTransportMeansMapper.INSTANCE.mapToVesselTransportMeansEntity(vesselTransportMeans);
    assertEquals(vesselTransportMeans.getGrantedFLAPDocuments().get(0).getID().getValue(), vesselTransportMeansEntity.getFlapDocuments().iterator().next().getFlapDocumentId());
    assertEquals(vesselTransportMeans.getGrantedFLAPDocuments().get(0).getID().getSchemeID(), vesselTransportMeansEntity.getFlapDocuments().iterator().next().getFlapDocumentSchemeId());
    assertTrue(vesselTransportMeansEntity.getName().startsWith(vesselTransportMeans.getNames().get(0).getValue()));
    assertEquals(vesselTransportMeans.getRoleCode().getValue(), vesselTransportMeansEntity.getRoleCode());
    assertEquals(vesselTransportMeans.getRoleCode().getListID(), vesselTransportMeansEntity.getRoleCodeListId());
    assertEquals(vesselTransportMeans.getRegistrationVesselCountry().getID().getSchemeID(), vesselTransportMeansEntity.getCountrySchemeId());
    assertEquals(vesselTransportMeans.getRegistrationVesselCountry().getID().getValue(), vesselTransportMeansEntity.getCountry());
    assertNotNull(vesselTransportMeansEntity.getVesselIdentifiers());
    VesselIdentifierEntity vesselIdentifierEntity = vesselTransportMeansEntity.getVesselIdentifiers().iterator().next();
    assertEquals(vesselTransportMeans.getIDS().get(0).getValue(), vesselIdentifierEntity.getVesselIdentifierId());
    assertEquals(vesselTransportMeans.getIDS().get(0).getSchemeID(), vesselIdentifierEntity.getVesselIdentifierSchemeId());
    assertNotNull(vesselTransportMeansEntity.getContactParty());
    vesselTransportMeansEntity = vesselTransportMeansEntity.getContactParty().iterator().next().getVesselTransportMeans();
    assertEquals(vesselTransportMeans.getGrantedFLAPDocuments().get(0).getID().getValue(), vesselTransportMeansEntity.getFlapDocuments().iterator().next().getFlapDocumentId());
    assertEquals(vesselTransportMeans.getGrantedFLAPDocuments().get(0).getID().getSchemeID(), vesselTransportMeansEntity.getFlapDocuments().iterator().next().getFlapDocumentSchemeId());
    assertTrue(vesselTransportMeansEntity.getName().startsWith(vesselTransportMeans.getNames().get(0).getValue()));
    assertEquals(vesselTransportMeans.getRoleCode().getValue(), vesselTransportMeansEntity.getRoleCode());
    assertEquals(vesselTransportMeans.getRoleCode().getListID(), vesselTransportMeansEntity.getRoleCodeListId());
    assertNotNull(vesselTransportMeansEntity.getRegistrationEvent());
    vesselTransportMeansEntity = vesselTransportMeansEntity.getRegistrationEvent().getVesselTransportMeanses();
    assertEquals(vesselTransportMeans.getGrantedFLAPDocuments().get(0).getID().getValue(), vesselTransportMeansEntity.getFlapDocuments().iterator().next().getFlapDocumentId());
    assertEquals(vesselTransportMeans.getGrantedFLAPDocuments().get(0).getID().getSchemeID(), vesselTransportMeansEntity.getFlapDocuments().iterator().next().getFlapDocumentSchemeId());
    assertTrue(vesselTransportMeansEntity.getName().startsWith(vesselTransportMeans.getNames().get(0).getValue()));
    assertEquals(vesselTransportMeans.getRoleCode().getValue(), vesselTransportMeansEntity.getRoleCode());
    assertEquals(vesselTransportMeans.getRoleCode().getListID(), vesselTransportMeansEntity.getRoleCodeListId());
}
Also used : VesselTransportMeansEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselTransportMeansEntity) VesselIdentifierEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselIdentifierEntity) VesselTransportMeans(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans) Test(org.junit.Test)

Example 12 with VesselTransportMeans

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

the class MapperUtil method getVesselTransportMeans.

public static VesselTransportMeans getVesselTransportMeans() {
    VesselTransportMeans vesselTransportMeans = new VesselTransportMeans();
    CodeType roleCode = getCodeType("CATCHING_VESSEL", "FA_VESSEL_ROLE");
    List<TextType> names = Arrays.asList(getTextType("Test Name"));
    List<FLAPDocument> grantedFLAPDocuments = Arrays.asList(getFlapDocument());
    List<IDType> ids = Arrays.asList(getIdType("ID 1", "CFR"));
    List<ContactParty> specifiedContactParties = Arrays.asList(getContactParty());
    List<RegistrationEvent> specifiedRegistrationEvents = Arrays.asList(getRegistrationEvent());
    VesselCountry vesselCounty = new VesselCountry(getIdType("Country Id 1", "tu587r-5jt85-tjfur7-tjgut7"));
    vesselTransportMeans.setRoleCode(roleCode);
    vesselTransportMeans.setNames(names);
    vesselTransportMeans.setGrantedFLAPDocuments(grantedFLAPDocuments);
    vesselTransportMeans.setIDS(ids);
    vesselTransportMeans.setSpecifiedContactParties(specifiedContactParties);
    vesselTransportMeans.setSpecifiedRegistrationEvents(specifiedRegistrationEvents);
    vesselTransportMeans.setRegistrationVesselCountry(vesselCounty);
    return vesselTransportMeans;
}
Also used : VesselCountry(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselCountry) RegistrationEvent(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationEvent) FLAPDocument(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) VesselTransportMeans(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) ContactParty(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactParty)

Example 13 with VesselTransportMeans

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

VesselTransportMeans (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans)7 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)5 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)4 VesselTransportMeansEntity (eu.europa.ec.fisheries.ers.fa.entities.VesselTransportMeansEntity)3 VesselIdentifierEntity (eu.europa.ec.fisheries.ers.fa.entities.VesselIdentifierEntity)2 ArrayList (java.util.ArrayList)2 ContactParty (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactParty)2 FLAPDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument)2 FishingActivity (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity)2 RegistrationEvent (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationEvent)2 VesselCountry (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselCountry)2 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)2 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)2 ContactPartyEntity (eu.europa.ec.fisheries.ers.fa.entities.ContactPartyEntity)1 HashSet (java.util.HashSet)1 Test (org.junit.Test)1 ContactPerson (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactPerson)1 DelimitedPeriod (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod)1 FACatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)1 FAReportDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FAReportDocument)1