use of org.kuali.kfs.krad.bo.DocumentHeader in project cu-kfs by CU-CommunityApps.
the class CuFinancialMaintenanceDocumentActionTest method createMockDocumentHeader.
protected DocumentHeader createMockDocumentHeader(DocumentStatus documentStatus) {
DocumentHeader documentHeader = mock(FinancialSystemDocumentHeader.class);
WorkflowDocument mockWorkflowDocument = createMockWorkflowDocument(documentStatus);
when(documentHeader.getWorkflowDocument()).thenReturn(mockWorkflowDocument);
return documentHeader;
}
use of org.kuali.kfs.krad.bo.DocumentHeader in project cu-kfs by CU-CommunityApps.
the class CuFinancialMaintenanceDocumentActionTest method setupMockMaintenanceDocument.
protected void setupMockMaintenanceDocument(Class<? extends PersistableBusinessObject> dataObjectClass, DocumentStatus documentStatus, String objectId) {
Maintainable mockMaintainable = createMockMaintainable(dataObjectClass, objectId);
PersistableBusinessObject mockDataObject = (PersistableBusinessObject) mockMaintainable.getDataObject();
DocumentHeader mockDocumentHeader = createMockDocumentHeader(documentStatus);
testDocument = mock(FinancialSystemMaintenanceDocument.class);
when(((FinancialSystemMaintenanceDocument) testDocument).getNewMaintainableObject()).thenReturn(mockMaintainable);
when(testDocument.getNoteTarget()).thenReturn(mockDataObject);
when(testDocument.getDocumentHeader()).thenReturn(mockDocumentHeader);
}
use of org.kuali.kfs.krad.bo.DocumentHeader in project cu-kfs by CU-CommunityApps.
the class AccountReversionTrickleDownInactivationServiceImpl method addNotesToDocument.
/**
* Adds notes about inactivated AccountReversions, any errors while persisting inactivated account reversions or account reversions that were loccked.
*
* @param documentNumber
* @param inactivatedAccountReversions
* @param alreadyLockedAccountReversions
* @param errorPersistingAccountReversions
*/
protected void addNotesToDocument(String documentNumber, List<AccountReversion> inactivatedAccountReversions, Map<AccountReversion, String> alreadyLockedAccountReversions, List<AccountReversion> errorPersistingAccountReversions) {
if (inactivatedAccountReversions.isEmpty() && alreadyLockedAccountReversions.isEmpty() && errorPersistingAccountReversions.isEmpty()) {
// if we didn't try to inactivate any AccountReversions, then don't bother
return;
}
DocumentHeader noteParent = documentHeaderService.getDocumentHeaderById(documentNumber);
Note newNote = new Note();
addNotes(documentNumber, inactivatedAccountReversions, CUKFSKeyConstants.ACCOUNT_REVERSION_TRICKLE_DOWN_INACTIVATION, noteParent, newNote);
addNotes(documentNumber, errorPersistingAccountReversions, CUKFSKeyConstants.ACCOUNT_REVERSION_TRICKLE_DOWN_INACTIVATION_ERROR_DURING_PERSISTENCE, noteParent, newNote);
addMaintenanceLockedNotes(documentNumber, alreadyLockedAccountReversions, CUKFSKeyConstants.ACCOUNT_REVERSION_TRICKLE_DOWN_INACTIVATION_RECORD_ALREADY_MAINTENANCE_LOCKED, noteParent, newNote);
}
use of org.kuali.kfs.krad.bo.DocumentHeader in project cu-kfs by CU-CommunityApps.
the class CuFinancialMaintenanceDocumentActionTest method setupMockTransactionalDocument.
protected void setupMockTransactionalDocument(DocumentStatus documentStatus) {
testDocument = mock(FinancialSystemTransactionalDocumentBase.class);
DocumentHeader mockDocumentHeader = createMockDocumentHeader(documentStatus);
when(testDocument.getDocumentHeader()).thenReturn(mockDocumentHeader);
}
Aggregations