Search in sources :

Example 16 with FlatFilePropertySpecification

use of org.kuali.kfs.sys.batch.FlatFilePropertySpecification in project cu-kfs by CU-CommunityApps.

the class AchIncomeDelimitedFlatFileSpecificationTest method testParseLineIntoObjectAchIncomeFileTransaction.

@Test
public void testParseLineIntoObjectAchIncomeFileTransaction() 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");
    setFlatFileProperty(parseProperties, 10, "companyId");
    flatFileObjectSpecification.setParseProperties(parseProperties);
    AchIncomeFileTransaction achIncomeFileTransaction = new AchIncomeFileTransaction();
    achIncomeDelimitedFlatFileSpecification.parseLineIntoObject(flatFileObjectSpecification, BPR_LINE1, achIncomeFileTransaction, 1);
    assertEquals(new KualiDecimal("12761.79"), achIncomeFileTransaction.getTransactionAmount());
    assertEquals("C", achIncomeFileTransaction.getCreditDebitIndicator());
    assertEquals("ACH", achIncomeFileTransaction.getPaymentMethodCode());
    assertEquals(null, achIncomeFileTransaction.getEffectiveDate());
    assertEquals("1111541330", achIncomeFileTransaction.getCompanyId());
}
Also used : AchIncomeFileTransaction(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransaction) FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) ArrayList(java.util.ArrayList) KualiDecimal(org.kuali.rice.core.api.util.type.KualiDecimal) FlatFilePropertySpecification(org.kuali.kfs.sys.batch.FlatFilePropertySpecification) DelimitedFlatFilePropertySpecification(org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification) AbstractFlatFileObjectSpecification(org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)16 AbstractFlatFileObjectSpecification (org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification)16 DelimitedFlatFilePropertySpecification (org.kuali.kfs.sys.batch.DelimitedFlatFilePropertySpecification)16 FlatFilePrefixObjectSpecification (org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification)16 FlatFilePropertySpecification (org.kuali.kfs.sys.batch.FlatFilePropertySpecification)16 Test (org.junit.Test)15 KualiDecimal (org.kuali.rice.core.api.util.type.KualiDecimal)3 AchIncomeFileTransaction (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransaction)2 AchIncomeFile (edu.cornell.kfs.fp.businessobject.AchIncomeFile)1 AchIncomeFileGroup (edu.cornell.kfs.fp.businessobject.AchIncomeFileGroup)1 AchIncomeFileGroupTrailer (edu.cornell.kfs.fp.businessobject.AchIncomeFileGroupTrailer)1 AchIncomeFileTrailer (edu.cornell.kfs.fp.businessobject.AchIncomeFileTrailer)1 AchIncomeFileTransactionDateTime (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionDateTime)1 AchIncomeFileTransactionNote (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionNote)1 AchIncomeFileTransactionOpenItemReference (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionOpenItemReference)1 AchIncomeFileTransactionPayerOrPayeeName (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionPayerOrPayeeName)1 AchIncomeFileTransactionPremiumPayersAdminsContact (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionPremiumPayersAdminsContact)1 AchIncomeFileTransactionPremiumReceiverName (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionPremiumReceiverName)1 AchIncomeFileTransactionReference (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionReference)1 AchIncomeFileTransactionSet (edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet)1