use of org.kuali.kfs.sys.batch.FlatFilePropertySpecification in project cu-kfs by CU-CommunityApps.
the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionOpenItemReference.
@Test
public void testParseLineIntoObjectAchIncomeFileTransactionOpenItemReference() throws Exception {
AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
setFlatFileProperty(parseProperties, 1, "type");
setFlatFileProperty(parseProperties, 2, "invoiceNumber");
setFlatFileProperty(parseProperties, 4, "netAmount", KualiDecimalFormatter.class);
setFlatFileProperty(parseProperties, 5, "invoiceAmount", KualiDecimalFormatter.class);
flatFileObjectSpecification.setParseProperties(parseProperties);
AchIncomeFileTransactionOpenItemReference achIncomeFileTransactionOpenItemReference = new AchIncomeFileTransactionOpenItemReference();
achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, RMR_LINE, achIncomeFileTransactionOpenItemReference, 1);
assertEquals("IV", achIncomeFileTransactionOpenItemReference.getType());
assertEquals("20", achIncomeFileTransactionOpenItemReference.getInvoiceNumber());
assertEquals(new KualiDecimal("3131.04"), achIncomeFileTransactionOpenItemReference.getNetAmount());
assertEquals(new KualiDecimal("2424.65"), achIncomeFileTransactionOpenItemReference.getInvoiceAmount());
}
use of org.kuali.kfs.sys.batch.FlatFilePropertySpecification in project cu-kfs by CU-CommunityApps.
the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileGroupTrailer.
@Test
public void testParseLineIntoObjectAchIncomeFileGroupTrailer() throws Exception {
AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
setFlatFileProperty(parseProperties, 1, "totalTransactionSets", IntegerFormatter.class);
setFlatFileProperty(parseProperties, 2, "groupControlNumber");
flatFileObjectSpecification.setParseProperties(parseProperties);
AchIncomeFileGroupTrailer achIncomeFileGroupTrailer = new AchIncomeFileGroupTrailer();
achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, GE_LINE, achIncomeFileGroupTrailer, 1);
assertEquals(1, achIncomeFileGroupTrailer.getTotalTransactionSets());
assertEquals("092016170", achIncomeFileGroupTrailer.getGroupControlNumber());
}
use of org.kuali.kfs.sys.batch.FlatFilePropertySpecification in project cu-kfs by CU-CommunityApps.
the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTrailer.
@Test
public void testParseLineIntoObjectAchIncomeFileTrailer() throws Exception {
AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
setFlatFileProperty(parseProperties, 1, "totalGroups", IntegerFormatter.class);
setFlatFileProperty(parseProperties, 2, "interchangeControlNumber");
flatFileObjectSpecification.setParseProperties(parseProperties);
AchIncomeFileTrailer achIncomeFileTrailer = new AchIncomeFileTrailer();
achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, IEA_LINE, achIncomeFileTrailer, 1);
assertEquals(1, achIncomeFileTrailer.getTotalGroups());
assertEquals("092016170", achIncomeFileTrailer.getInterchangeControlNumber());
}
use of org.kuali.kfs.sys.batch.FlatFilePropertySpecification in project cu-kfs by CU-CommunityApps.
the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionTrace.
@Test
public void testParseLineIntoObjectAchIncomeFileTransactionTrace() throws Exception {
AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
setFlatFileProperty(parseProperties, 2, "traceNumber");
flatFileObjectSpecification.setParseProperties(parseProperties);
AchIncomeFileTransactionTrace achIncomeFileTransactionTrace = new AchIncomeFileTransactionTrace();
achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, TRN_LINE, achIncomeFileTransactionTrace, 1);
assertEquals("041036009100170", achIncomeFileTransactionTrace.getTraceNumber());
}
use of org.kuali.kfs.sys.batch.FlatFilePropertySpecification in project cu-kfs by CU-CommunityApps.
the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionDateTime.
@Test
public void testParseLineIntoObjectAchIncomeFileTransactionDateTime() throws Exception {
AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
setFlatFileProperty(parseProperties, 1, "type");
setFlatFileProperty(parseProperties, 2, "dateTime");
flatFileObjectSpecification.setParseProperties(parseProperties);
AchIncomeFileTransactionDateTime achIncomeFileTransactionDateTime = new AchIncomeFileTransactionDateTime();
achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, DTM_LINE, achIncomeFileTransactionDateTime, 1);
assertEquals("097", achIncomeFileTransactionDateTime.getType());
assertEquals("20160222", achIncomeFileTransactionDateTime.getDateTime());
}
Aggregations