Author: surajk
Date: Sat May 25 16:45:44 2019
New Revision: 1860005
URL: http://svn.apache.org/viewvc?rev=1860005&view=rev
Log:
Improved: Unit test case for service - CreateReturnItemShipment.
(OFBIZ-8859)
Thanks Avnindra Sharma for reporting the issue and Yogesh Naroliya for
providing the patch.
Modified:
ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/test/OrderTests.groovy
ofbiz/ofbiz-framework/trunk/applications/order/testdef/data/OrderTestData.xml
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=1860005&r1=1860004&r2=1860005&view=diff
==============================================================================
---
ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/test/OrderTests.groovy
(original)
+++
ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/test/OrderTests.groovy
Sat May 25 16:45:44 2019
@@ -63,11 +63,23 @@ class OrderTests extends GroovyScriptTes
//TODO: This can be moved to a different file
void testCheckCreateProductRequirementForFacility() {
Map serviceCtx = [
- facilityId: 'WebStoreWarehouse',
- orderItemSeqId: '00001',
- userLogin:
EntityQuery.use(delegator).from('UserLogin').where('userLoginId',
'system').cache().queryOne()
+ facilityId: 'WebStoreWarehouse',
+ orderItemSeqId: '00001',
+ userLogin:
EntityQuery.use(delegator).from('UserLogin').where('userLoginId',
'system').cache().queryOne()
]
Map serviceResult =
dispatcher.runSync('checkCreateProductRequirementForFacility', serviceCtx)
assert ServiceUtil.isSuccess(serviceResult)
}
+ void testCreateReturnItemShipment() {
+ Map serviceCtx = [
+ shipmentId: '1014',
+ shipmentItemSeqId: '00001',
+ returnId: '1009',
+ returnItemSeqId: '00001',
+ quantity: new BigDecimal('2.0000'),
+ userLogin:
EntityQuery.use(delegator).from('UserLogin').where('userLoginId',
'system').cache().queryOne()
+ ]
+ Map serviceResult = dispatcher.runSync('createReturnItemShipment',
serviceCtx)
+ assert ServiceUtil.isSuccess(serviceResult)
+ }
}
\ No newline at end of file
Modified:
ofbiz/ofbiz-framework/trunk/applications/order/testdef/data/OrderTestData.xml
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/testdef/data/OrderTestData.xml?rev=1860005&r1=1860004&r2=1860005&view=diff
==============================================================================
---
ofbiz/ofbiz-framework/trunk/applications/order/testdef/data/OrderTestData.xml
(original)
+++
ofbiz/ofbiz-framework/trunk/applications/order/testdef/data/OrderTestData.xml
Sat May 25 16:45:44 2019
@@ -56,5 +56,8 @@ under the License.
<WorkEffort workEffortId="9000" workEffortTypeId="PROJECT"
currentStatusId="_NA_" lastStatusUpdate="2007-12-14 15:07:52.901"
scopeEnumId="WES_PRIVATE" workEffortName="Demo Project1 Cust1"
revisionNumber="1"/>
<Requirement requirementId="1000"
requirementTypeId="CUSTOMER_REQUIREMENT"/>
<ReturnHeader returnId="1009" statusId="RETURN_RECEIVED"
returnHeaderTypeId="CUSTOMER_RETURN"/>
+ <ReturnItem returnId="1009" returnItemSeqId="00001"
returnReasonId="RTN_NOT_WANT" returnTypeId="RTN_REFUND"
returnItemTypeId="RET_FPROD_ITEM" returnQuantity="1.000000"/>
+ <Shipment shipmentId="1014" shipmentTypeId="SALES_SHIPMENT"
primaryOrderId="DEMO10090" primaryShipGroupSeqId="00001"
statusId="SHIPMENT_SHIPPED"/>
+ <ShipmentItem shipmentId="1014" shipmentItemSeqId="00001"/>
</entity-engine-xml>