use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapCountryID.
private void mapCountryID(RegistrationLocation target, RegistrationLocationEntity source) {
if (ObjectUtils.allNotNull(target, source)) {
IDType idType = new IDType();
idType.setSchemeID(source.getLocationCountrySchemeId());
idType.setValue(source.getLocationCountryId());
target.setCountryID(idType);
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method setDescriptions.
private void setDescriptions(RegistrationLocation target, RegistrationLocationEntity source) {
if (ObjectUtils.allNotNull(target, source)) {
TextType textType = new TextType();
textType.setValue(source.getDescription());
textType.setLanguageID(source.getDescLanguageId());
target.setDescriptions(singletonList(textType));
}
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation 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 un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getRegistrationLocation.
public static RegistrationLocation getRegistrationLocation() {
IDType countryID = getIdType("XEU", "TERRITORY");
List<TextType> descriptions = Arrays.asList(getTextType("This is Test Text"));
CodeType geopoliticalRegionCode = getCodeType("Region Code 1", "57tug6-tfu576-5tud75-t57e5td-56tdwe");
List<IDType> ids = Arrays.asList(getIdType("ID 2", "fhtyr8-45jrf-5784fhrt-thf75"));
List<TextType> names = Arrays.asList(getTextType("This is Test Name"));
CodeType typeCode = getCodeType("Code type 1", "475rhf-587trhdy-thgy576-thfr64");
RegistrationLocation registrationLocation = new RegistrationLocation(countryID, descriptions, geopoliticalRegionCode, ids, names, typeCode, null);
return registrationLocation;
}
Aggregations