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());
}
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;
}
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;
}
Aggregations