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;
}
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);
}
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);
}
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;
}
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;
}
Aggregations