Improved: Unit test case for service - SendOrderBackorderNotification
As Suraj somehow mentioned at
we can use the same ticket while converting the test to Groov
Tests pass
Thanks: Avnindra Sharma for the initial patch (here converted to Groovy)
@@ -224,5 +224,15 @@ class OrderTests extends OFBizTestCase {
assert serviceResult.emailType.equals("PRDS_ODR_CHANGE")
}
+ void testSendOrderBackorderNotification() {
+ Map serviceCtx = [
+ orderId: 'TEST_DEMO10090',
+ sendTo: 'test_email@example.com',
+ userLogin: EntityQuery.use(delegator).from('UserLogin').where('userLoginId', 'system').cache().queryOne()
+ ]
+ Map serviceResult = dispatcher.runSync('sendOrderBackorderNotification', serviceCtx)
+ assert ServiceUtil.isSuccess(serviceResult)
+ assert serviceResult.emailType.equals("PRDS_ODR_BACKORDER")
+ }
}
