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