Search in sources :

Example 1 with AbstractFlatFileObjectSpecification

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());
}
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) SimpleDateFormat(java.text.SimpleDateFormat) AbstractFlatFileObjectSpecification(org.kuali.kfs.sys.batch.AbstractFlatFileObjectSpecification) Date(java.util.Date) Test(org.junit.Test)

Example 2 with AbstractFlatFileObjectSpecification

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());
}
Also used : FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) AchIncomeFileTransactionPremiumReceiverName(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionPremiumReceiverName) ArrayList(java.util.ArrayList) 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)

Example 3 with AbstractFlatFileObjectSpecification

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());
}
Also used : FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) AchIncomeFileTransactionSet(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSet) ArrayList(java.util.ArrayList) 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)

Example 4 with AbstractFlatFileObjectSpecification

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());
}
Also used : FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) AchIncomeFileGroup(edu.cornell.kfs.fp.businessobject.AchIncomeFileGroup) ArrayList(java.util.ArrayList) 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)

Example 5 with AbstractFlatFileObjectSpecification

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());
}
Also used : FlatFilePrefixObjectSpecification(org.kuali.kfs.sys.batch.FlatFilePrefixObjectSpecification) AchIncomeFileTransactionSetTrailer(edu.cornell.kfs.fp.businessobject.AchIncomeFileTransactionSetTrailer) ArrayList(java.util.ArrayList) 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