svn commit: r1858283 - in /ofbiz/ofbiz-framework/trunk/applications/accounting: groovyScripts/test/AutoAcctgPaymentTests.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: r1858283 - in /ofbiz/ofbiz-framework/trunk/applications/accounting: groovyScripts/test/AutoAcctgPaymentTests.groovy testdef/data/AccountingTestsData.xml

surajk
Author: surajk
Date: Sat Apr 27 15:34:37 2019
New Revision: 1858283

URL: http://svn.apache.org/viewvc?rev=1858283&view=rev
Log:
Improved: Unit test case for service - quickSendPayment.
(OFBIZ-9086)
Thanks Deepak Nigam for reporting the ticket and Anushi Gupta for providing the patch.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentTests.groovy
    ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/data/AccountingTestsData.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentTests.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentTests.groovy?rev=1858283&r1=1858282&r2=1858283&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentTests.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentTests.groovy Sat Apr 27 15:34:37 2019
@@ -52,4 +52,16 @@ class AutoAcctgPaymentTests extends Groo
         assert payment
         assert serviceResult.oldStatusId == 'PAYMENT_NOT_AUTH'
     }
+
+    void testQuickSendPayment() {
+        Map serviceCtx = [:]
+        serviceCtx.paymentId = '1001'
+        serviceCtx.userLogin = EntityQuery.use(delegator).from('UserLogin').where('userLoginId', 'system').cache().queryOne()
+        Map serviceResult = dispatcher.runSync('quickSendPayment', serviceCtx)
+        assert ServiceUtil.isSuccess(serviceResult)
+
+        GenericValue payment = EntityQuery.use(delegator).from('Payment').where('paymentId', '1001').queryOne()
+        assert payment
+        assert payment.statusId == 'PMNT_SENT'
+    }
 }

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=1858283&r1=1858282&r2=1858283&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/data/AccountingTestsData.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/data/AccountingTestsData.xml Sat Apr 27 15:34:37 2019
@@ -102,4 +102,7 @@ under the License.
     <Content contentId="1000" contentTypeId="DOCUMENT"/>
     <!-- For Testing service setPaymentStatus -->
     <Payment paymentId="1000" paymentTypeId="CUSTOMER_PAYMENT" paymentMethodTypeId="COMPANY_CHECK"  partyIdFrom="DEMO_COMPANY" partyIdTo="DEMO_COMPANY1" amount="100.00" statusId="PAYMENT_NOT_AUTH" />
+    <!-- For Testing service quickSendPayment -->
+    <PaymentMethod paymentMethodId="1001" paymentMethodTypeId="COMPANY_CHECK"/>
+    <Payment paymentId="1001" paymentTypeId="CUSTOMER_PAYMENT" paymentMethodId="1001" paymentMethodTypeId="COMPANY_CHECK" partyIdFrom="DEMO_COMPANY" partyIdTo="DEMO_COMPANY1" amount="100.00" statusId="PMNT_CONFIRMED"/>
 </entity-engine-xml>