Search in sources :

Example 6 with RegistrationEvent

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

the class RegistrationEventMapperTest method testRegistrationEventMapper.

@Test
public void testRegistrationEventMapper() {
    RegistrationEvent registrationEvent = MapperUtil.getRegistrationEvent();
    RegistrationEventEntity registrationEventEntity = RegistrationEventMapper.INSTANCE.mapToRegistrationEventEntity(registrationEvent);
    assertTrue(registrationEventEntity.getDescription().startsWith(registrationEvent.getDescriptions().get(0).getValue()));
    assertEquals(registrationEvent.getOccurrenceDateTime().getDateTime().toGregorianCalendar().getTime(), registrationEventEntity.getOccurrenceDatetime());
    assertNotNull(registrationEventEntity.getRegistrationLocation());
    registrationEventEntity = registrationEventEntity.getRegistrationLocation().getRegistrationEvent();
    assertTrue(registrationEventEntity.getDescription().startsWith(registrationEvent.getDescriptions().get(0).getValue()));
    assertEquals(registrationEvent.getOccurrenceDateTime().getDateTime().toGregorianCalendar().getTime(), registrationEventEntity.getOccurrenceDatetime());
}
Also used : RegistrationEvent(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationEvent) RegistrationEventEntity(eu.europa.ec.fisheries.ers.fa.entities.RegistrationEventEntity) Test(org.junit.Test)

Example 7 with RegistrationEvent

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

Aggregations

RegistrationEvent (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationEvent)4 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)3 RegistrationLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation)2 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)2 RegistrationEventEntity (eu.europa.ec.fisheries.ers.fa.entities.RegistrationEventEntity)1 Test (org.junit.Test)1 ContactParty (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactParty)1 FLAPDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument)1 VesselCountry (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselCountry)1 VesselTransportMeans (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans)1 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)1 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)1