use of org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification in project cu-kfs by CU-CommunityApps.
the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionWithDate.
@Test
public void testParseLineIntoObjectAchIncomeFileTransactionWithDate() throws Exception {
AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
setFlatFileProperty(parseProperties, 2, "transactionAmount", KualiDecimalFormatter.class);
setFlatFileProperty(parseProperties, 3, "creditDebitIndicator");
setFlatFileProperty(parseProperties, 4, "paymentMethodCode");
setFlatFileProperty(parseProperties, 16, "effectiveDate", BatchDateFormatter.class, DATE_FORMAT);
setFlatFileProperty(parseProperties, 10, "companyId");
flatFileObjectSpecification.setParseProperties(parseProperties);
AchIncomeFileTransaction achIncomeFileTransaction = new AchIncomeFileTransaction();
achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, BPR_LINE2, achIncomeFileTransaction, 1);
Date expectedDate = new SimpleDateFormat(DATE_FORMAT).parse("20160223");
assertEquals(new KualiDecimal("3131.04"), achIncomeFileTransaction.getTransactionAmount());
assertEquals("C", achIncomeFileTransaction.getCreditDebitIndicator());
assertEquals("ACH", achIncomeFileTransaction.getPaymentMethodCode());
assertEquals(expectedDate, achIncomeFileTransaction.getEffectiveDate());
assertEquals("3041036004", achIncomeFileTransaction.getCompanyId());
}
use of org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification in project cu-kfs by CU-CommunityApps.
the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionPremiumReceiverName.
@Test
public void testParseLineIntoObjectAchIncomeFileTransactionPremiumReceiverName() throws Exception {
AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
setFlatFileProperty(parseProperties, 3, "name");
flatFileObjectSpecification.setParseProperties(parseProperties);
AchIncomeFileTransactionPremiumReceiverName achIncomeFileTransactionPremiumReceiverName = new AchIncomeFileTransactionPremiumReceiverName();
achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, NM1_LINE, achIncomeFileTransactionPremiumReceiverName, 1);
assertEquals("PREMIUM RECEIVER NAME", achIncomeFileTransactionPremiumReceiverName.getName());
}
use of org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification in project cu-kfs by CU-CommunityApps.
the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionSet.
@Test
public void testParseLineIntoObjectAchIncomeFileTransactionSet() throws Exception {
AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
setFlatFileProperty(parseProperties, 2, "transactionSetControlNumber");
flatFileObjectSpecification.setParseProperties(parseProperties);
AchIncomeFileTransactionSet achIncomeFileTransactionSet = new AchIncomeFileTransactionSet();
achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, ST_LINE, achIncomeFileTransactionSet, 1);
assertEquals("0001", achIncomeFileTransactionSet.getTransactionSetControlNumber());
}
use of org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification in project cu-kfs by CU-CommunityApps.
the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileGroup.
@Test
public void testParseLineIntoObjectAchIncomeFileGroup() throws Exception {
AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
setFlatFileProperty(parseProperties, 6, "groupControlNumber");
setFlatFileProperty(parseProperties, 1, "groupFunctionIdentifierCode");
flatFileObjectSpecification.setParseProperties(parseProperties);
AchIncomeFileGroup achIncomeFileGroup = new AchIncomeFileGroup();
achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, GS_LINE, achIncomeFileGroup, 1);
assertEquals("0", achIncomeFileGroup.getGroupControlNumber());
assertEquals("RA", achIncomeFileGroup.getGroupFunctionIdentifierCode());
}
use of org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification in project cu-kfs by CU-CommunityApps.
the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransactionSetTrailer.
@Test
public void testParseLineIntoObjectAchIncomeFileTransactionSetTrailer() throws Exception {
AbstractFlatFileObjectSpecification flatFileObjectSpecification = new FlatFilePrefixObjectSpecification();
List<FlatFilePropertySpecification> parseProperties = new ArrayList<>();
setFlatFileProperty(parseProperties, 2, "transactionSetControlNumber");
flatFileObjectSpecification.setParseProperties(parseProperties);
AchIncomeFileTransactionSetTrailer achIncomeFileTransactionSetTrailer = new AchIncomeFileTransactionSetTrailer();
achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, SE_LINE, achIncomeFileTransactionSetTrailer, 1);
assertEquals("000000001", achIncomeFileTransactionSetTrailer.getTransactionSetControlNumber());
}
Aggregations