Search in sources :

Example 6 with ConcurStandardAccountingExtractFile

use of edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractFile in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractServiceImpl method loadConcurStandardAccountingExtractFile.

private ConcurStandardAccountingExtractFile loadConcurStandardAccountingExtractFile(String standardAccountingExtractFileName) {
    ConcurStandardAccountingExtractFile concurStandardAccountingExtractFile;
    File standardAccountingExtractFile = new File(standardAccountingExtractFileName);
    List parsed = (List) batchInputFileService.parse(batchInputFileType, safelyLoadFileBytes(standardAccountingExtractFile));
    if (parsed == null || parsed.size() != 1) {
        LOG.error("parseStandardAccoutingExtractFileToStandardAccountingExtractFile, Unable to parse the file into exactly 1 POJO");
        throw new ValidationException("parseStandardAccoutingExtractFileToStandardAccountingExtractFile, did not parse the file into exactly 1 parse file ");
    }
    concurStandardAccountingExtractFile = (ConcurStandardAccountingExtractFile) parsed.get(0);
    concurStandardAccountingExtractFile.setOriginalFileName(standardAccountingExtractFile.getName());
    return concurStandardAccountingExtractFile;
}
Also used : ValidationException(org.kuali.kfs.krad.exception.ValidationException) ConcurStandardAccountingExtractFile(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractFile) List(java.util.List) ConcurStandardAccountingExtractFile(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractFile) File(java.io.File)

Example 7 with ConcurStandardAccountingExtractFile

use of edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractFile 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));
}
Also used : ConcurStandardAccountingExtractFile(edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractFile) ConcurStandardAccountingExtractBatchReportData(edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData)

Aggregations

ConcurStandardAccountingExtractFile (edu.cornell.kfs.concur.batch.businessobject.ConcurStandardAccountingExtractFile)7 ConcurStandardAccountingExtractBatchReportData (edu.cornell.kfs.concur.batch.report.ConcurStandardAccountingExtractBatchReportData)3 ConcurSAEDetailLineFixture (edu.cornell.kfs.concur.batch.fixture.ConcurSAEDetailLineFixture)1 File (java.io.File)1 IOException (java.io.IOException)1 Date (java.sql.Date)1 List (java.util.List)1 CollectorBatch (org.kuali.kfs.gl.batch.CollectorBatch)1 ValidationException (org.kuali.kfs.krad.exception.ValidationException)1 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)1