Author: jleroux
Date: Thu Oct  3 11:30:28 2019
New Revision: 1867927

URL: http://svn.apache.org/viewvc?rev=1867927&view=rev
Log:
Improved: Convert testSendOrderChangeNotification to Groovy
(OFBIZ-11233)

Tests pass

Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/minilang/test/OrderTests.xml
    
ofbiz/ofbiz-framework/trunk/applications/order/src/main/groovy/org/apache/ofbiz/order/OrderTests.groovy

Modified: 
ofbiz/ofbiz-framework/trunk/applications/order/minilang/test/OrderTests.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/minilang/test/OrderTests.xml?rev=1867927&r1=1867926&r2=1867927&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/minilang/test/OrderTests.xml 
(original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/minilang/test/OrderTests.xml 
Thu Oct  3 11:30:28 2019
@@ -154,23 +154,4 @@ under the License.
         </assert>
         <check-errors/>
     </simple-method>
-    
-    <simple-method method-name="testSendOrderChangeNotification" 
short-description="Sends order change confirmation mail" login-required="false">
-        <entity-one entity-name="UserLogin" value-field="userLogin">
-            <field-map field-name="userLoginId" value="system"/>
-        </entity-one>
-        <set-current-user-login value-field="userLogin"/>
-        <set field="serviceCtx.orderId" value="TEST_DEMO10090"/>
-        <set field="serviceCtx.note" value="Test Note"/>
-        <set field="serviceCtx.comments" value="Test comments"/>
-        <set field="serviceCtx.sendTo" value="[email protected]"/>
-        <call-service service-name="sendOrderChangeNotification" 
in-map-name="serviceCtx">
-            <results-to-map map-name="serviceResult"/>
-        </call-service>
-        <assert>
-            <not><if-empty field="serviceResult"/></not>
-            <if-compare operator="equals" field="serviceResult.emailType" 
value="PRDS_ODR_CHANGE" />
-        </assert>
-        <check-errors/>
-    </simple-method>
 </simple-methods>
\ No newline at end of file

Modified: 
ofbiz/ofbiz-framework/trunk/applications/order/src/main/groovy/org/apache/ofbiz/order/OrderTests.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/groovy/org/apache/ofbiz/order/OrderTests.groovy?rev=1867927&r1=1867926&r2=1867927&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/applications/order/src/main/groovy/org/apache/ofbiz/order/OrderTests.groovy
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/applications/order/src/main/groovy/org/apache/ofbiz/order/OrderTests.groovy
 Thu Oct  3 11:30:28 2019
@@ -212,4 +212,17 @@ class OrderTests extends OFBizTestCase {
         Map serviceResult = 
dispatcher.runSync('associatedRequirementWithRequestItem', serviceCtx)
         assert ServiceUtil.isSuccess(serviceResult)
     }
+    
+    void testSendOrderChangeNotification() {
+        Map serviceCtx = [
+                  orderId: 'TEST_DEMO10090',
+                  sendTo: '[email protected]',
+                  userLogin: 
EntityQuery.use(delegator).from('UserLogin').where('userLoginId', 
'system').cache().queryOne()
+        ]
+        Map serviceResult = dispatcher.runSync('sendOrderChangeNotification', 
serviceCtx)
+        assert ServiceUtil.isSuccess(serviceResult)
+        assert serviceResult.emailType.equals("PRDS_ODR_CHANGE")
+    }
+    
+    
 }


Reply via email to