use of edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountExtractPdpEntryServiceImplTest method setUp.
@Before
public void setUp() throws Exception {
pdpEntryService = new ConcurStandardAccountExtractPdpEntryServiceImpl();
pdpEntryService.setPayeeNameFieldSize(new Integer(40));
pdpEntryService.setDateTimeService(new DateTimeServiceImpl());
reportData = new ConcurStandardAccountingExtractBatchReportData();
}
use of edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountingExtractCollectorBatchBuilderTest method assertCollectorBatchIsBuiltProperly.
protected void assertCollectorBatchIsBuiltProperly(ConcurCollectorBatchFixture expectedFixture, ConcurSAEFileFixture fixtureToBuildFrom) throws Exception {
CollectorBatch expected = expectedFixture.toCollectorBatch();
List<ConcurSAEDetailLineFixture> lineFixtures = ConcurFixtureUtils.getFixturesContainingParentFixture(ConcurSAEDetailLineFixture.class, fixtureToBuildFrom, ConcurSAEDetailLineFixture::getExtractFile);
ConcurStandardAccountingExtractFile saeFileContents = fixtureToBuildFrom.toExtractFile();
ConcurStandardAccountingExtractBatchReportData reportData = new ConcurStandardAccountingExtractBatchReportData();
CollectorBatch actual = builder.buildCollectorBatchFromStandardAccountingExtract(1, saeFileContents, reportData);
assertNotNull("The SAE file contents should have been converted to a CollectorBatch successfully", actual);
assertCollectorBatchHasCorrectData(expected, actual);
assertReportHasCorrectErrorLinesAndOrdering(lineFixtures, reportData);
assertReportHasCorrectPendingClientLinesAndOrdering(lineFixtures, reportData);
assertReportHasCorrectCashAdvanceStatistics(lineFixtures, reportData);
assertReportHasCorrectCorporateCardStatistics(lineFixtures, reportData);
assertReportHasCorrectPseudoPaymentCodeStatistics(lineFixtures, reportData);
}
use of edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountingExtractCreateCollectorFileServiceImplTest method assertCollectorFileIsGeneratedCorrectly.
protected void assertCollectorFileIsGeneratedCorrectly(String expectedResultsFileName, ConcurCollectorBatchFixture fixture) throws Exception {
ConcurStandardAccountingExtractBatchReportData reportData = new ConcurStandardAccountingExtractBatchReportData();
ConcurStandardAccountingExtractFile saeFileContents = new ConcurStandardAccountingExtractFile();
saeFileContents.setOriginalFileName(fixture.name() + GeneralLedgerConstants.BatchFileSystem.TEXT_EXTENSION);
String collectorFileName = collectorFileService.buildCollectorFile(saeFileContents, reportData);
assertTrue("Collector file did not get created successfully", StringUtils.isNotBlank(collectorFileName));
assertGeneratedCollectorFileHasCorrectName(saeFileContents.getOriginalFileName(), collectorFileName);
String expectedResultsFilePath = EXPECTED_RESULTS_DIRECTORY_PATH + expectedResultsFileName;
String actualResultsFilePath = COLLECTOR_OUTPUT_DIRECTORY_PATH + collectorFileName;
assertFileContentsAreCorrect(expectedResultsFilePath, actualResultsFilePath);
}
use of edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountingExtractToPdpAndCollectorStep method execute.
@Override
public boolean execute(String jobName, Date jobRunDate) throws InterruptedException {
List<String> listOfSaeFullyQualifiedFileNames = getConcurStandardAccountingExtractService().buildListOfFullyQualifiedFileNamesToBeProcessed();
if (CollectionUtils.isNotEmpty(listOfSaeFullyQualifiedFileNames)) {
for (String saeFullyQualifiedFileName : listOfSaeFullyQualifiedFileNames) {
LOG.debug("execute, processing: " + saeFullyQualifiedFileName);
ConcurStandardAccountingExtractBatchReportData reportData = new ConcurStandardAccountingExtractBatchReportData();
try {
processCurrentFileAndExtractPdpFeedAndCollectorFromSAEFile(saeFullyQualifiedFileName, reportData);
File reportFile = getConcurStandardAccountingExtractReportService().generateReport(reportData);
getConcurStandardAccountingExtractReportService().sendResultsEmail(reportData, reportFile);
} catch (Exception e) {
LOG.error("execute, there was an unexpected error processing a file: ", e);
} finally {
getFileStorageService().removeDoneFiles(Collections.singletonList(saeFullyQualifiedFileName));
}
}
} else {
LOG.info("There were no SAE files to process");
getConcurStandardAccountingExtractReportService().sendEmailThatNoFileWasProcesed();
}
return true;
}
use of edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData in project cu-kfs by CU-CommunityApps.
the class ConcurStandardAccountingExtractCreateCollectorFileServiceImplTest method assertCollectorFileIsNotGenerated.
protected void assertCollectorFileIsNotGenerated(String fixtureName) throws Exception {
ConcurStandardAccountingExtractBatchReportData reportData = new ConcurStandardAccountingExtractBatchReportData();
ConcurStandardAccountingExtractFile saeFileContents = new ConcurStandardAccountingExtractFile();
saeFileContents.setOriginalFileName(fixtureName + GeneralLedgerConstants.BatchFileSystem.TEXT_EXTENSION);
String collectorFilePath = collectorFileService.buildCollectorFile(saeFileContents, reportData);
assertTrue("A Collector file should not have been created", StringUtils.isBlank(collectorFilePath));
}
Aggregations