Search in sources :

Example 1 with FlatFileParserBase

use of org.kuali.kfs.sys.batch.FlatFileParserBase 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");
}
Also used : EmailServiceImpl(org.kuali.kfs.sys.service.impl.EmailServiceImpl) FlatFileParserBase(org.kuali.kfs.sys.batch.FlatFileParserBase) ArrayList(java.util.ArrayList) BatchInputFileType(org.kuali.kfs.sys.batch.BatchInputFileType) BatchInputFileService(org.kuali.kfs.sys.batch.service.BatchInputFileService)

Aggregations

ArrayList (java.util.ArrayList)1 BatchInputFileType (org.kuali.kfs.sys.batch.BatchInputFileType)1 FlatFileParserBase (org.kuali.kfs.sys.batch.FlatFileParserBase)1 BatchInputFileService (org.kuali.kfs.sys.batch.service.BatchInputFileService)1 EmailServiceImpl (org.kuali.kfs.sys.service.impl.EmailServiceImpl)1