Search in sources :

Example 1 with DataDictionaryService

use of org.kuali.kfs.datadictionary.legacy.DataDictionaryService in project cu-kfs by CU-CommunityApps.

the class PersonInquirableImpl method buildQualifierAttributeFieldMap.

private Map<String, Field> buildQualifierAttributeFieldMap(List<KimTypeAttribute> attributeDefinitions) {
    Map<String, Field> fieldsToAdd = new LinkedHashMap<>();
    attributeDefinitions.sort(Comparator.comparing(KimTypeAttribute::getSortCode));
    attributeDefinitions.stream().map(KimTypeAttribute::getKimAttribute).forEach(kimAttribute -> {
        String componentName = kimAttribute.getComponentName();
        String attributeName = kimAttribute.getAttributeName();
        DataDictionaryService dataDictionaryService = getDataDictionaryService();
        Field newField = new Field();
        newField.setFieldLabel(dataDictionaryService.getAttributeLabel(componentName, attributeName));
        newField.setFieldShortLabel(dataDictionaryService.getAttributeShortLabel(componentName, attributeName));
        newField.setPropertyName(attributeName);
        newField.setFieldType(Field.TEXT);
        fieldsToAdd.put(attributeName, newField);
    });
    return fieldsToAdd;
}
Also used : Field(org.kuali.kfs.kns.web.ui.Field) DataDictionaryService(org.kuali.kfs.datadictionary.legacy.DataDictionaryService) LinkedHashMap(java.util.LinkedHashMap)

Example 2 with DataDictionaryService

use of org.kuali.kfs.datadictionary.legacy.DataDictionaryService in project cu-kfs by CU-CommunityApps.

the class CuBatchExtractServiceImplTest method setUp.

@Before
public void setUp() throws Exception {
    BusinessObjectService businessObjectService = buildMockBusinessObjectService();
    DataDictionaryService dataDictionaryService = buildMockDataDictionaryService();
    cuBatchExtractServiceImpl = new CuBatchExtractServiceImpl();
    cuBatchExtractServiceImpl.setBusinessObjectService(businessObjectService);
    cuBatchExtractServiceImpl.setDataDictionaryService(dataDictionaryService);
}
Also used : DataDictionaryService(org.kuali.kfs.datadictionary.legacy.DataDictionaryService) BusinessObjectService(org.kuali.kfs.krad.service.BusinessObjectService) Before(org.junit.Before)

Example 3 with DataDictionaryService

use of org.kuali.kfs.datadictionary.legacy.DataDictionaryService in project cu-kfs by CU-CommunityApps.

the class CuCreditMemoServiceImplTest method setUp.

@Before
public void setUp() throws Exception {
    accountsPayableService = Mockito.mock(AccountsPayableService.class);
    Mockito.when(accountsPayableService.getExpiredOrClosedAccountList(Mockito.any())).thenReturn(new HashMap<>());
    dataDictionaryService = Mockito.mock(DataDictionaryService.class);
    Mockito.when(dataDictionaryService.getAttributeMaxLength(DocumentHeader.class, KRADPropertyConstants.DOCUMENT_DESCRIPTION)).thenReturn(200);
    dateTimeService = new DateTimeServiceImpl();
    documentService = buildMockDocumentService();
    noteService = Mockito.mock(NoteService.class);
    purapService = Mockito.mock(PurapService.class);
    vendorService = new MockVendorServiceImpl();
    creditMemoServiceImpl = PowerMockito.spy(new TestCuCreditMemoServiceImpl());
    PowerMockito.doNothing().when(creditMemoServiceImpl, "reIndexDocument", Mockito.any());
    creditMemoServiceImpl.setDocumentService(documentService);
    creditMemoServiceImpl.setNoteService(noteService);
    creditMemoServiceImpl.setPurapService(purapService);
    creditMemoServiceImpl.setAccountsPayableService(accountsPayableService);
    creditMemoServiceImpl.setVendorService(vendorService);
    creditMemoServiceImpl.setDataDictionaryService(dataDictionaryService);
    creditMemoDocument = setupVendorCreditMemoDocument();
    mls398Person = MockPersonUtil.createMockPerson(UserNameFixture.mls398);
    mls398Session = MockPersonUtil.createMockUserSession(mls398Person);
    GlobalVariables.setUserSession(mls398Session);
}
Also used : DateTimeServiceImpl(org.kuali.kfs.core.impl.datetime.DateTimeServiceImpl) PurapService(org.kuali.kfs.module.purap.document.service.PurapService) NoteService(org.kuali.kfs.krad.service.NoteService) AccountsPayableService(org.kuali.kfs.module.purap.document.service.AccountsPayableService) DataDictionaryService(org.kuali.kfs.datadictionary.legacy.DataDictionaryService) Before(org.junit.Before)

Example 4 with DataDictionaryService

use of org.kuali.kfs.datadictionary.legacy.DataDictionaryService 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)

Example 5 with DataDictionaryService

use of org.kuali.kfs.datadictionary.legacy.DataDictionaryService in project cu-kfs by CU-CommunityApps.

the class RassMockServiceFactory method buildMockDataDictionaryService.

public DataDictionaryService buildMockDataDictionaryService() throws Exception {
    DataDictionaryService dataDictionaryService = Mockito.mock(DataDictionaryService.class);
    Mockito.when(dataDictionaryService.getAttributeMaxLength(Mockito.any(Class.class), Mockito.anyString())).thenReturn(RassTestConstants.DEFAULT_DD_FIELD_MAX_LENGTH);
    return dataDictionaryService;
}
Also used : DataDictionaryService(org.kuali.kfs.datadictionary.legacy.DataDictionaryService)

Aggregations

DataDictionaryService (org.kuali.kfs.datadictionary.legacy.DataDictionaryService)7 Before (org.junit.Before)2 CuCheckingSavingsValuesFinder (edu.cornell.kfs.coa.businessobject.options.CuCheckingSavingsValuesFinder)1 TestPayeeAchIdTypeValuesFinder (edu.cornell.kfs.pdp.businessobject.options.TestPayeeAchIdTypeValuesFinder)1 LinkedHashMap (java.util.LinkedHashMap)1 DateTimeServiceImpl (org.kuali.kfs.core.impl.datetime.DateTimeServiceImpl)1 Field (org.kuali.kfs.kns.web.ui.Field)1 AttributeDefinition (org.kuali.kfs.krad.datadictionary.AttributeDefinition)1 BusinessObjectService (org.kuali.kfs.krad.service.BusinessObjectService)1 NoteService (org.kuali.kfs.krad.service.NoteService)1 Agency (org.kuali.kfs.module.cg.businessobject.Agency)1 AccountsPayableService (org.kuali.kfs.module.purap.document.service.AccountsPayableService)1 PurapService (org.kuali.kfs.module.purap.document.service.PurapService)1