Search in sources :

Example 1 with RegistrationEventEntity

use of eu.europa.ec.fisheries.ers.fa.entities.RegistrationEventEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class VesselTransportMeansMapper method getRegistrationEventEntity.

protected RegistrationEventEntity getRegistrationEventEntity(List<RegistrationEvent> registrationEvents, VesselTransportMeansEntity vesselTransportMeansEntity) {
    if (registrationEvents == null || registrationEvents.isEmpty()) {
        return null;
    }
    RegistrationEventEntity registrationEventEntity = RegistrationEventMapper.INSTANCE.mapToRegistrationEventEntity(registrationEvents.get(0));
    registrationEventEntity.setVesselTransportMeanses(vesselTransportMeansEntity);
    return registrationEventEntity;
}
Also used : RegistrationEventEntity(eu.europa.ec.fisheries.ers.fa.entities.RegistrationEventEntity)

Example 2 with RegistrationEventEntity

use of eu.europa.ec.fisheries.ers.fa.entities.RegistrationEventEntity 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)

Aggregations

RegistrationEventEntity (eu.europa.ec.fisheries.ers.fa.entities.RegistrationEventEntity)2 Test (org.junit.Test)1 RegistrationEvent (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationEvent)1