Search in sources :

Example 6 with PersonImpl

use of org.kuali.kfs.kim.impl.identity.PersonImpl in project cu-kfs by CU-CommunityApps.

the class CuBatchInputFileServiceImplTest method testSave.

/*
     * This is the core test of CU modification
     * If the input file type is not CuBatchInputFileType then we create the
     * done file.  If it is of type CuBatchInputFileType then we also must call the
     * isDoneFileRequired function.
     * 1. PCDO is used to test the original save is fine.
     * 2. AccountReversion is used to test not to create 'done' file
     * This is based on BatchInputFileTypeServiceTest
     */
public final void testSave() throws Exception {
    // GlobalVariables.getUserSession().getPerson();
    user = new PersonImpl();
    String savedFileName = batchInputFileService.save(user, pcdoBatchInputFileType, testFileIdentifier, validPcdoFileContents, new ArrayList());
    File expectedFile = new File(savedFileName);
    createdTestFiles.add(expectedFile);
    // Make sure CU mods does not affect the inputfiletype is not an instance of CuBatchInputFileType
    assertTrue("uploaded pcdo file not found", expectedFile.exists());
    assertTrue("uploaded pcdo file is empty", expectedFile.length() > 0);
    checkForDoneFile(expectedFile, true);
    // remove file so we can test collector upload
    expectedFile.delete();
    // Make sure CU mods is correct; not to create done file
    savedFileName = batchInputFileService.save(user, accountReversionInputFileType, testFileIdentifier, validAccountReversionFileContents, null);
    expectedFile = new File(savedFileName);
    createdTestFiles.add(expectedFile);
    assertTrue("uploaded AccountReversion file not found", expectedFile.exists());
    assertTrue("uploaded AccountReversion file is empty", expectedFile.length() > 0);
    checkForDoneFile(expectedFile, false);
}
Also used : PersonImpl(org.kuali.kfs.kim.impl.identity.PersonImpl) ArrayList(java.util.ArrayList) File(java.io.File)

Aggregations

PersonImpl (org.kuali.kfs.kim.impl.identity.PersonImpl)6 ArrayList (java.util.ArrayList)3 Person (org.kuali.kfs.kim.api.identity.Person)2 PersonService (org.kuali.kfs.kim.api.identity.PersonService)2 EntityAffiliation (org.kuali.kfs.kim.impl.identity.affiliation.EntityAffiliation)2 CuDisbursementPayee (edu.cornell.kfs.fp.businessobject.CuDisbursementPayee)1 CuDisbursementVoucherDocument (edu.cornell.kfs.fp.document.CuDisbursementVoucherDocument)1 VendorInactivateConvertBatchCsvInputFileType (edu.cornell.kfs.vnd.batch.VendorInactivateConvertBatchCsvInputFileType)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 KualiDecimal (org.kuali.kfs.core.api.util.type.KualiDecimal)1 DisbursementPayee (org.kuali.kfs.fp.businessobject.DisbursementPayee)1 WorkflowException (org.kuali.kfs.kew.api.exception.WorkflowException)1 InquirySectionDefinition (org.kuali.kfs.kns.datadictionary.InquirySectionDefinition)1 InquiryRestrictions (org.kuali.kfs.kns.inquiry.InquiryRestrictions)1 Row (org.kuali.kfs.kns.web.ui.Row)1 Section (org.kuali.kfs.kns.web.ui.Section)1 UserSession (org.kuali.kfs.krad.UserSession)1