use of org.kuali.kfs.vnd.businessobject.VendorContact in project cu-kfs by CU-CommunityApps.
the class PaymentWorksVendorToKfsVendorDetailConversionServiceImplTest method testBuildContactWithEmptyPhone.
@Test
void testBuildContactWithEmptyPhone() {
VendorContact actualContact = conversionService.buildContact(PaymentWorksConstants.KFSVendorContactTypes.E_INVOICING, PaymentWorksConstants.KFSVendorContactPhoneTypes.E_INVOICING, CONTACT_NAME, CONTACT_EMAIL_ADDRESS, StringUtils.EMPTY, StringUtils.EMPTY);
assertBaseContactDetails(actualContact);
assertEquals(0, CollectionUtils.size(actualContact.getVendorContactPhoneNumbers()));
}
use of org.kuali.kfs.vnd.businessobject.VendorContact in project cu-kfs by CU-CommunityApps.
the class PaymentWorksVendorToKfsVendorDetailConversionServiceImplTest method testBuildContactWithNullPhone.
@Test
void testBuildContactWithNullPhone() {
VendorContact actualContact = conversionService.buildContact(PaymentWorksConstants.KFSVendorContactTypes.E_INVOICING, PaymentWorksConstants.KFSVendorContactPhoneTypes.E_INVOICING, CONTACT_NAME, CONTACT_EMAIL_ADDRESS, null, null);
assertBaseContactDetails(actualContact);
assertEquals(0, CollectionUtils.size(actualContact.getVendorContactPhoneNumbers()));
}
use of org.kuali.kfs.vnd.businessobject.VendorContact in project cu-kfs by CU-CommunityApps.
the class PaymentWorksVendorToKfsVendorDetailConversionServiceImplTest method testBuildContactWithPhone.
@Test
void testBuildContactWithPhone() {
VendorContact actualContact = conversionService.buildContact(PaymentWorksConstants.KFSVendorContactTypes.E_INVOICING, PaymentWorksConstants.KFSVendorContactPhoneTypes.E_INVOICING, CONTACT_NAME, CONTACT_EMAIL_ADDRESS, CONTACT_PHONE_NUMBER, CONTACT_PHONE_NUMBER_EXTENSION);
assertBaseContactDetails(actualContact);
assertEquals(1, CollectionUtils.size(actualContact.getVendorContactPhoneNumbers()));
VendorContactPhoneNumber actualPhoneContact = actualContact.getVendorContactPhoneNumbers().get(0);
assertEquals(PaymentWorksConstants.KFSVendorContactPhoneTypes.E_INVOICING, actualPhoneContact.getVendorPhoneTypeCode());
assertEquals(CONTACT_PHONE_NUMBER, actualPhoneContact.getVendorPhoneNumber());
assertEquals(CONTACT_PHONE_NUMBER_EXTENSION, actualPhoneContact.getVendorPhoneExtensionNumber());
}
use of org.kuali.kfs.vnd.businessobject.VendorContact in project cu-kfs by CU-CommunityApps.
the class VendorRule method processContactValidation.
/**
* A stub method as placeholder for future Contact Validation
*
* @return boolean false or true
*/
private boolean processContactValidation() {
boolean valid = true;
int i = 0;
for (VendorContact contact : newVendor.getVendorContacts()) {
String errorPath = MAINTAINABLE_ERROR_PREFIX + VendorPropertyConstants.VENDOR_CONTACT + "[" + i + "]";
GlobalVariables.getMessageMap().addToErrorPath(errorPath);
this.getDictionaryValidationService().validateBusinessObject(contact);
// ==== CU Customization ====
int j = 0;
for (VendorContactPhoneNumber contactPhoneNumber : contact.getVendorContactPhoneNumbers()) {
String errorSubPath = VendorPropertyConstants.VENDOR_CONTACT_PHONE_NUMBER + "[" + j + "]";
GlobalVariables.getMessageMap().addToErrorPath(errorSubPath);
this.getDictionaryValidationService().validateBusinessObject(contactPhoneNumber);
GlobalVariables.getMessageMap().removeFromErrorPath(errorSubPath);
j++;
}
// ==== End CU Customization Section ====
Map<String, AutoPopulatingList<ErrorMessage>> errors = GlobalVariables.getMessageMap().getErrorMessages();
if (errors != null && !errors.isEmpty()) {
valid = false;
}
i++;
GlobalVariables.getMessageMap().clearErrorPath();
}
return valid;
}
use of org.kuali.kfs.vnd.businessobject.VendorContact in project cu-kfs by CU-CommunityApps.
the class PaymentWorksVendorToKfsVendorDetailConversionServiceImplTest method testBuildContactWithPhoneNoExtension.
@Test
void testBuildContactWithPhoneNoExtension() {
VendorContact actualContact = conversionService.buildContact(PaymentWorksConstants.KFSVendorContactTypes.E_INVOICING, PaymentWorksConstants.KFSVendorContactPhoneTypes.E_INVOICING, CONTACT_NAME, CONTACT_EMAIL_ADDRESS, CONTACT_PHONE_NUMBER, StringUtils.EMPTY);
assertBaseContactDetails(actualContact);
assertEquals(1, CollectionUtils.size(actualContact.getVendorContactPhoneNumbers()));
VendorContactPhoneNumber actualPhoneContact = actualContact.getVendorContactPhoneNumbers().get(0);
assertEquals(PaymentWorksConstants.KFSVendorContactPhoneTypes.E_INVOICING, actualPhoneContact.getVendorPhoneTypeCode());
assertEquals(CONTACT_PHONE_NUMBER, actualPhoneContact.getVendorPhoneNumber());
assertEquals(null, actualPhoneContact.getVendorPhoneExtensionNumber());
}
Aggregations