use of org.kuali.kfs.sys.batch.service.BatchInputFileService in project cu-kfs by CU-CommunityApps.
the class AdvanceDepositServiceImplTest method additionalSetupForFileProcessing.
protected void additionalSetupForFileProcessing() throws IOException, ParseException {
List<String> fileNames = new ArrayList<>();
fileNames.add(GOOD_DATA_FILE);
fileNames.add(EMPTY_DATA_FILE);
fileNames.add(GOOD_DATA_FILE_2);
BatchInputFileService batchInputFileService = EasyMock.createMock(CuBatchInputFileServiceImpl.class);
EasyMock.expect(batchInputFileService.listInputFileNamesWithDoneFile(EasyMock.isA(BatchInputFileType.class))).andReturn(fileNames);
EasyMock.expect(batchInputFileService.parse(EasyMock.isA(BatchInputFileType.class), EasyMock.isA(byte[].class))).andReturn(setupAchIncomeFilesGood()).andThrow(new RuntimeException()).andReturn(setupAchIncomeFilesGood());
EasyMock.replay(batchInputFileService);
advanceDepositService.setBatchInputFileService(batchInputFileService);
advanceDepositService.setEmailService(new EmailServiceImpl());
achIncomeInputFileType = new FlatFileParserBase();
achIncomeInputFileType.setDirectoryPath(BATCH_DIRECTORY);
achIncomeInputFileType.setFileExtension(TXT_FILE_EXTENSION);
advanceDepositService.setBatchInputFileType(achIncomeInputFileType);
setupBatchFiles(DATA_FILE_GOOD_NAME);
setupBatchFiles(DATA_FILE_EMPTY_NAME);
setupBatchFiles(DATA_FILE_GOOD_NAME + "2");
}
Aggregations