use of eu.europa.ec.fisheries.ers.fa.entities.ContactPersonEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityDataUtil method getContactPartyEntity.
public static ContactPartyEntity getContactPartyEntity(String title, String givenName, String middleName, String familyName, String familyNamePrefix, String nameSuffix, String gender, String alias) {
ContactPartyEntity contPartEntity = new ContactPartyEntity();
ContactPersonEntity contactPersonEntity = new ContactPersonEntity();
contactPersonEntity.setTitle(title);
contactPersonEntity.setGivenName(givenName);
contactPersonEntity.setMiddleName(middleName);
contactPersonEntity.setFamilyName(familyName);
contactPersonEntity.setFamilyNamePrefix(familyNamePrefix);
contactPersonEntity.setNameSuffix(nameSuffix);
contactPersonEntity.setGender(gender);
contactPersonEntity.setAlias(alias);
contPartEntity.setContactPerson(contactPersonEntity);
return contPartEntity;
}
use of eu.europa.ec.fisheries.ers.fa.entities.ContactPersonEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class ContactPartyMapper method getContactPersonEntity.
protected ContactPersonEntity getContactPersonEntity(List<ContactPerson> contactPersons, ContactPartyEntity contactPartyEntity) {
if (CollectionUtils.isEmpty(contactPersons)) {
return null;
}
ContactPersonEntity contactPersonEntity = ContactPersonMapper.INSTANCE.mapToContactPersonEntity(contactPersons.get(0));
contactPersonEntity.setContactParty(contactPartyEntity);
return contactPersonEntity;
}
use of eu.europa.ec.fisheries.ers.fa.entities.ContactPersonEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class ContactPartyMapperTest method testContactPartyMapperNullReturns.
@Test
public void testContactPartyMapperNullReturns() {
Set<ContactPartyRoleEntity> contactPartyRoles = ContactPartyMapper.INSTANCE.getContactPartyRoles(null, new ContactPartyEntity());
assertTrue(contactPartyRoles.size() == 0);
ContactPersonEntity contactPersonEntity = ContactPartyMapper.INSTANCE.getContactPersonEntity(null, new ContactPartyEntity());
assertNull(contactPersonEntity);
Set<StructuredAddressEntity> structuredAddressEntity = ContactPartyMapper.INSTANCE.getStructuredAddressEntity(null, new ContactPartyEntity());
assertTrue(structuredAddressEntity.size() == 0);
}
use of eu.europa.ec.fisheries.ers.fa.entities.ContactPersonEntity 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 eu.europa.ec.fisheries.ers.fa.entities.ContactPersonEntity 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