Search in sources :

Example 1 with CuCheckingSavingsValuesFinder

use of edu.cornell.kfs.coa.businessobject.options.CuCheckingSavingsValuesFinder in project cu-kfs by CU-CommunityApps.

the class PayeeACHAccountExtractServiceImplTest method createMockDataDictionaryService.

private DataDictionaryService createMockDataDictionaryService() throws Exception {
    final String PAYEE_ACH_ACCOUNT_CLASSNAME = PayeeACHAccount.class.getName();
    final String DOCUMENT_HEADER_CLASSNAME = DocumentHeader.class.getName();
    /*
         * Only a few specific attribute definitions should be masked or have values finders; the rest
         * should be plain. Also, we only care about the max lengths of a few specific properties.
         */
    DataDictionaryService ddService = mock(DataDictionaryService.class);
    AttributeDefinition maskedAttribute = createMaskedAttributeDefinition();
    AttributeDefinition unmaskedAttribute = createUnmaskedAttributeDefinition();
    AttributeDefinition payeeIdTypeAttribute = createAttributeDefinitionWithValuesFinder(new TestPayeeAchIdTypeValuesFinder(), false);
    AttributeDefinition bankAccountTypeAttribute = createAttributeDefinitionWithValuesFinder(new CuCheckingSavingsValuesFinder(), true);
    when(ddService.getAttributeDefinition(PAYEE_ACH_ACCOUNT_CLASSNAME, PdpPropertyConstants.PAYEE_IDENTIFIER_TYPE_CODE)).thenReturn(payeeIdTypeAttribute);
    when(ddService.getAttributeDefinition(PAYEE_ACH_ACCOUNT_CLASSNAME, PdpPropertyConstants.PAYEE_ID_NUMBER)).thenReturn(unmaskedAttribute);
    when(ddService.getAttributeDefinition(PAYEE_ACH_ACCOUNT_CLASSNAME, CUPdpPropertyConstants.BANK_ACCOUNT_TYPE_CODE)).thenReturn(bankAccountTypeAttribute);
    when(ddService.getAttributeDefinition(PAYEE_ACH_ACCOUNT_CLASSNAME, CUPdpPropertyConstants.PAYEE_ACH_BANK_NAME)).thenReturn(maskedAttribute);
    when(ddService.getAttributeDefinition(PAYEE_ACH_ACCOUNT_CLASSNAME, KFSPropertyConstants.BANK_ACCOUNT_NUMBER)).thenReturn(maskedAttribute);
    when(ddService.getAttributeMaxLength(DOCUMENT_HEADER_CLASSNAME, KRADPropertyConstants.DOCUMENT_DESCRIPTION)).thenReturn(DOCUMENT_DESCRIPTION_MAX_LENGTH);
    return ddService;
}
Also used : CuCheckingSavingsValuesFinder(edu.cornell.kfs.coa.businessobject.options.CuCheckingSavingsValuesFinder) AttributeDefinition(org.kuali.kfs.krad.datadictionary.AttributeDefinition) TestPayeeAchIdTypeValuesFinder(edu.cornell.kfs.pdp.businessobject.options.TestPayeeAchIdTypeValuesFinder) DataDictionaryService(org.kuali.kfs.datadictionary.legacy.DataDictionaryService)

Aggregations

CuCheckingSavingsValuesFinder (edu.cornell.kfs.coa.businessobject.options.CuCheckingSavingsValuesFinder)1 TestPayeeAchIdTypeValuesFinder (edu.cornell.kfs.pdp.businessobject.options.TestPayeeAchIdTypeValuesFinder)1 DataDictionaryService (org.kuali.kfs.datadictionary.legacy.DataDictionaryService)1 AttributeDefinition (org.kuali.kfs.krad.datadictionary.AttributeDefinition)1