svn commit: r1867921 - in /ofbiz/ofbiz-framework/trunk/applications/order: minilang/test/OrderTest.xml minilang/test/OrderTests.xml testdef/OrderTest.xml

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

svn commit: r1867921 - in /ofbiz/ofbiz-framework/trunk/applications/order: minilang/test/OrderTest.xml minilang/test/OrderTests.xml testdef/OrderTest.xml

jleroux@apache.org
Author: jleroux
Date: Thu Oct  3 09:28:37 2019
New Revision: 1867921

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

Fixes to right place

There were no reasons to add an OrderTest.xml file,
testSendOrderChangeNotification fits in OrderTests.xml

It was even wrong because of duplicated order-test test-case

Tests pass

Removed:
    ofbiz/ofbiz-framework/trunk/applications/order/minilang/test/OrderTest.xml
Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/minilang/test/OrderTests.xml
    ofbiz/ofbiz-framework/trunk/applications/order/testdef/OrderTest.xml

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=1867921&r1=1867920&r2=1867921&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 09:28:37 2019
@@ -154,4 +154,23 @@ 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="[hidden email]"/>
+        <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/testdef/OrderTest.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/testdef/OrderTest.xml?rev=1867921&r1=1867920&r2=1867921&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/testdef/OrderTest.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/testdef/OrderTest.xml Thu Oct  3 09:28:37 2019
@@ -34,9 +34,6 @@ under the License.
         <junit-test-suite class-name="org.apache.ofbiz.order.test.SalesOrderTest"/>
     </test-case>
     <test-case case-name="order-test">
-        <simple-method-test location="component://order/minilang/test/OrderTest.xml"/>
-    </test-case>
-    <test-case case-name="order-test">
         <simple-method-test location="component://order/minilang/test/OrderTests.xml"/>
     </test-case>
     <test-case case-name="order-tests">