svn commit: r1861813 - /ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/test/OrderTests.groovy

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

svn commit: r1861813 - /ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/test/OrderTests.groovy

surajk
Author: surajk
Date: Sat Jun 22 05:14:07 2019
New Revision: 1861813

URL: http://svn.apache.org/viewvc?rev=1861813&view=rev
Log:
Improved: JUnit test case for Creating a Retrun Header.
(OFBIZ-8808)
Committing slightly modified patch.Thanks Avnindra Sharma for reporting and Yogesh Naroliya for providing the updated patch.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/test/OrderTests.groovy

Modified: ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/test/OrderTests.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/test/OrderTests.groovy?rev=1861813&r1=1861812&r2=1861813&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/test/OrderTests.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/test/OrderTests.groovy Sat Jun 22 05:14:07 2019
@@ -101,12 +101,22 @@ class OrderTests extends GroovyScriptTes
         Map serviceResult = dispatcher.runSync('createReturnItemShipment', serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
     }
-
     void testCreateReturnStatus() {
-        Map serviceCtx = [:]
-        serviceCtx.returnId = '1009'
-        serviceCtx.userLogin = EntityQuery.use(delegator).from('UserLogin').where('userLoginId', 'system').cache().queryOne()
+        Map serviceCtx = [
+            returnId: '1009',
+            userLogin: EntityQuery.use(delegator).from('UserLogin').where('userLoginId', 'system').cache().queryOne()
+        ]
         Map serviceResult = dispatcher.runSync('createReturnStatus', serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
     }
+    void testCreateReturnHeader() {
+        Map serviceCtx = [
+            toPartyId: 'Company',
+            returnHeaderTypeId: 'CUSTOMER_RETURN',
+            userLogin: EntityQuery.use(delegator).from('UserLogin').where('userLoginId', 'system').cache().queryOne()
+        ]
+        Map serviceResult = dispatcher.runSync('createReturnHeader', serviceCtx)
+        assert ServiceUtil.isSuccess(serviceResult)
+        assert serviceResult.returnId != null
+    }
 }
\ No newline at end of file