use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactPerson in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getContactPerson.
public static ContactPerson getContactPerson() {
TextType title = getTextType("MR");
TextType givenName = getTextType("Test Name");
TextType middleName = getTextType("Test Middle Name");
TextType familyNamePrefix = getTextType("Test Prefix");
TextType familyName = getTextType("Test Family Name");
TextType nameSuffix = getTextType("Test Suffix");
CodeType genderCode = getCodeType("Gender", "4ryf65-fhtfyd-thfey45-tu5r7ght");
TextType alias = getTextType("Test Alias");
// ContactPerson contactPerson = new ContactPerson();
ContactPerson contactPerson = new ContactPerson(title, givenName, middleName, familyNamePrefix, familyName, nameSuffix, genderCode, alias, null, null, null, null, null, null, null);
return contactPerson;
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactPerson in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapSpecifiedContactParties.
private void mapSpecifiedContactParties(VesselTransportMeans target, Set<ContactPartyEntity> contactPartyEntities) {
ArrayList<ContactParty> contactParties = new ArrayList<>();
if (CollectionUtils.isNotEmpty(contactPartyEntities)) {
for (ContactPartyEntity source : contactPartyEntities) {
ContactParty contactParty = new ContactParty();
ContactPerson contactPerson = ContactPersonMapper.INSTANCE.mapToContactPerson(source.getContactPerson());
if (contactPerson != null) {
// TODO @Greg mapstruct add non-iterable type
contactParty.setSpecifiedContactPersons(Collections.singletonList(contactPerson));
}
mapRoles(contactParty, source.getContactPartyRole());
contactParty.setSpecifiedStructuredAddresses(StructuredAddressMapper.INSTANCE.mapToStructuredAddressList(source.getStructuredAddresses()));
contactParties.add(contactParty);
}
}
target.setSpecifiedContactParties(contactParties);
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactPerson in project UVMS-ActivityModule-APP by UnionVMS.
the class ContactPersonMapperTest method testContactPersonMapper.
@Test
public void testContactPersonMapper() {
ContactPerson contactPerson = MapperUtil.getContactPerson();
ContactPersonEntity contactPersonEntity = ContactPersonMapper.INSTANCE.mapToContactPersonEntity(contactPerson);
assertEquals(contactPerson.getAlias().getValue(), contactPersonEntity.getAlias());
assertEquals(contactPerson.getFamilyName().getValue(), contactPersonEntity.getFamilyName());
assertEquals(contactPerson.getFamilyNamePrefix().getValue(), contactPersonEntity.getFamilyNamePrefix());
assertEquals(contactPerson.getGenderCode().getValue(), contactPersonEntity.getGender());
assertEquals(contactPerson.getGivenName().getValue(), contactPersonEntity.getGivenName());
assertEquals(contactPerson.getMiddleName().getValue(), contactPersonEntity.getMiddleName());
assertEquals(contactPerson.getNameSuffix().getValue(), contactPersonEntity.getNameSuffix());
assertEquals(contactPerson.getTitle().getValue(), contactPersonEntity.getTitle());
assertNull(contactPersonEntity.getContactParty());
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactPerson in project UVMS-ActivityModule-APP by UnionVMS.
the class ContactPersonMapperTest method testContactPersonDetailsDTOMapper.
@Test
public void testContactPersonDetailsDTOMapper() {
ContactPerson contactPerson = MapperUtil.getContactPerson();
ContactPersonEntity contactPersonEntity = ContactPersonMapper.INSTANCE.mapToContactPersonEntity(contactPerson);
ContactPersonDetailsDTO contactPersonDetailsDTO = ContactPersonMapper.INSTANCE.mapToContactPersonDetailsDTO(contactPersonEntity);
assertEquals(contactPersonEntity.getAlias(), contactPersonDetailsDTO.getAlias());
assertEquals(contactPersonEntity.getFamilyName(), contactPersonDetailsDTO.getFamilyName());
assertEquals(contactPersonEntity.getFamilyNamePrefix(), contactPersonDetailsDTO.getFamilyNamePrefix());
assertEquals(contactPersonEntity.getGender(), contactPersonDetailsDTO.getGender());
assertEquals(contactPersonEntity.getGivenName(), contactPersonDetailsDTO.getGivenName());
assertEquals(contactPersonEntity.getMiddleName(), contactPersonDetailsDTO.getMiddleName());
assertEquals(contactPersonEntity.getNameSuffix(), contactPersonDetailsDTO.getNameSuffix());
assertEquals(contactPersonEntity.getTitle(), contactPersonDetailsDTO.getTitle());
}
Aggregations