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