svn commit: r1868433 - in /ofbiz/ofbiz-framework/trunk/applications/accounting: src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgLedgerTests.groovy testdef/data/AccountingTestsData.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1868433 - in /ofbiz/ofbiz-framework/trunk/applications/accounting: src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgLedgerTests.groovy testdef/data/AccountingTestsData.xml

jleroux@apache.org
Author: jleroux
Date: Mon Oct 14 08:57:32 2019
New Revision: 1868433

URL: http://svn.apache.org/viewvc?rev=1868433&view=rev
Log:
Improved: Unit test case for service -  createAcctgTransEntry
(OFBIZ-9004)

Thanks: Deepak Nigam for initial patch and Suraj for Groovy conversion

Modified:
    ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgLedgerTests.groovy
    ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/data/AccountingTestsData.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgLedgerTests.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgLedgerTests.groovy?rev=1868433&r1=1868432&r2=1868433&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgLedgerTests.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgLedgerTests.groovy Mon Oct 14 08:57:32 2019
@@ -28,7 +28,6 @@ class AutoAcctgLedgerTests extends OFBiz
     public AutoAcctgLedgerTests(String name) {
         super(name)
     }
-
     void testCreateAcctgTrans() {
         Map serviceCtx = [:]
         serviceCtx.acctgTransTypeId = 'CREDIT_MEMO'
@@ -43,4 +42,15 @@ class AutoAcctgLedgerTests extends OFBiz
         assert acctgTrans.acctgTransId == serviceResult.acctgTransId
         assert acctgTrans.acctgTransTypeId == 'CREDIT_MEMO'
     }
+    void testCreateAcctgTransEntry() {
+        Map serviceCtx = [
+            acctgTransId: '1000',
+            organizationPartyId: 'DEMO_COMPANY',
+            debitCreditFlag: 'C',
+            userLogin: EntityQuery.use(delegator).from('UserLogin').where('userLoginId', 'system').cache().queryOne()
+        ]
+        Map serviceResult = dispatcher.runSync('createAcctgTransEntry', serviceCtx)
+        GenericValue acctgTransEntry = EntityQuery.use(delegator).from('AcctgTransEntry').where('acctgTransId', '1000', 'acctgTransEntrySeqId', serviceResult.acctgTransEntrySeqId).queryOne()
+        assert acctgTransEntry != null
+    }
 }

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/data/AccountingTestsData.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/data/AccountingTestsData.xml?rev=1868433&r1=1868432&r2=1868433&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/data/AccountingTestsData.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/data/AccountingTestsData.xml Mon Oct 14 08:57:32 2019
@@ -111,4 +111,6 @@ under the License.
     <Payment paymentId="1006" paymentTypeId="CUSTOMER_PAYMENT" paymentMethodTypeId="COMPANY_CHECK" partyIdFrom="DEMO_COMPANY" partyIdTo="DEMO_COMPANY1" amount="100.00" statusId="PMNT_CONFIRMED" />
     <Content contentId="1006" contentTypeId="DOCUMENT"/>
     <PaymentContentType paymentContentTypeId="COMMENTS" hasTable="N" />
+    <!-- For Testing service createAcctgTransEntry -->
+    <AcctgTrans acctgTransId="1000" acctgTransTypeId="CREDIT_MEMO" postedDate="2016-11-03 00:00:00"/>
 </entity-engine-xml>