use of eu.europa.ec.fisheries.ers.fa.entities.RegistrationLocationEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class BaseMapper method mapToRegistrationLocationEntity.
public static RegistrationLocationEntity mapToRegistrationLocationEntity(RegistrationLocation registrationLocation, RegistrationEventEntity registrationEventEntity) {
if (registrationLocation == null) {
return null;
}
RegistrationLocationEntity registrationLocationEntity = RegistrationLocationMapper.INSTANCE.mapToRegistrationLocationEntity(registrationLocation);
registrationLocationEntity.setRegistrationEvent(registrationEventEntity);
return registrationLocationEntity;
}
use of eu.europa.ec.fisheries.ers.fa.entities.RegistrationLocationEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class RegistrationLocationMapperTest method testRegistrationLocationMapper.
@Test
public void testRegistrationLocationMapper() {
RegistrationLocation registrationLocation = MapperUtil.getRegistrationLocation();
RegistrationLocationEntity registrationLocationEntity = RegistrationLocationMapper.INSTANCE.mapToRegistrationLocationEntity(registrationLocation);
assertTrue(registrationLocationEntity.getDescription().startsWith(registrationLocation.getDescriptions().get(0).getValue()));
assertTrue(registrationLocationEntity.getName().startsWith(registrationLocation.getNames().get(0).getValue()));
assertEquals(registrationLocation.getGeopoliticalRegionCode().getValue(), registrationLocationEntity.getRegionCode());
assertEquals(registrationLocation.getGeopoliticalRegionCode().getListID(), registrationLocationEntity.getRegionCodeListId());
assertEquals(registrationLocation.getCountryID().getValue(), registrationLocationEntity.getLocationCountryId());
assertEquals(registrationLocation.getCountryID().getSchemeID(), registrationLocationEntity.getLocationCountrySchemeId());
assertEquals(registrationLocation.getTypeCode().getValue(), registrationLocationEntity.getTypeCode());
assertEquals(registrationLocation.getTypeCode().getListID(), registrationLocationEntity.getTypeCodeListId());
assertNull(registrationLocationEntity.getRegistrationEvent());
}
use of eu.europa.ec.fisheries.ers.fa.entities.RegistrationLocationEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityDataUtil method getRegistrationLocationEntity.
public static RegistrationLocationEntity getRegistrationLocationEntity(String description, String regionCode, String regionCodeListId, String name, String typeCode, String typeCodeListId, String locationCountryId, String locationCountrySchemeId) {
RegistrationLocationEntity registrationLocationEntity = new RegistrationLocationEntity();
registrationLocationEntity.setDescription(description);
registrationLocationEntity.setRegionCode(regionCode);
registrationLocationEntity.setRegionCodeListId(regionCodeListId);
registrationLocationEntity.setName(name);
registrationLocationEntity.setTypeCode(typeCode);
registrationLocationEntity.setTypeCodeListId(typeCodeListId);
registrationLocationEntity.setLocationCountryId(locationCountryId);
registrationLocationEntity.setLocationCountrySchemeId(locationCountrySchemeId);
return registrationLocationEntity;
}
Aggregations