Author: surajk
Date: Sat Jan 12 06:51:13 2019 New Revision: 1851143 URL: http://svn.apache.org/viewvc?rev=1851143&view=rev Log: Added:Unit test case for service - CustRequestPermissionCheck. (OFBIZ-8958) Thanks Avnindra Sharma for reporting, Deepak Nigam and Yogesh Naroliya for providing the patches. Added: ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/test/ ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/test/TestCustRequestPermissionCheck.groovy (with props) Modified: ofbiz/ofbiz-framework/trunk/applications/order/testdef/CustRequestTests.xml Added: ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/test/TestCustRequestPermissionCheck.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/test/TestCustRequestPermissionCheck.groovy?rev=1851143&view=auto ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/test/TestCustRequestPermissionCheck.groovy (added) +++ ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/test/TestCustRequestPermissionCheck.groovy Sat Jan 12 06:51:13 2019 @@ -0,0 +1,35 @@ +/******************************************************************************* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + *******************************************************************************/ + + +import org.apache.ofbiz.entity.GenericValue +import org.apache.ofbiz.entity.util.EntityQuery +import org.apache.ofbiz.service.ServiceUtil +import org.apache.ofbiz.testtools.GroovyScriptTestCase + +class TestCustRequestPermissionCheck extends GroovyScriptTestCase { + void testCustRequestPermission() { + Map serviceCtx = [:] + serviceCtx.fromPartyId = 'Company' + serviceCtx.mainAction = 'TEST' + serviceCtx.userLogin = EntityQuery.use(delegator).from('UserLogin').where('userLoginId', 'system').cache().queryOne() + Map result = dispatcher.runSync('custRequestPermissionCheck', serviceCtx) + assert ServiceUtil.isSuccess(result) + } +} Propchange: ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/test/TestCustRequestPermissionCheck.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/test/TestCustRequestPermissionCheck.groovy ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/test/TestCustRequestPermissionCheck.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/ofbiz-framework/trunk/applications/order/testdef/CustRequestTests.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/testdef/CustRequestTests.xml?rev=1851143&r1=1851142&r2=1851143&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/testdef/CustRequestTests.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/testdef/CustRequestTests.xml Sat Jan 12 06:51:13 2019 @@ -25,4 +25,8 @@ under the License. <test-case case-name="custrequest-tests"> <simple-method-test location="component://order/minilang/test/CustRequestTests.xml"/> </test-case> + + <test-case case-name="test-cust-request-permission-check"> + <groovy-test-suite location="component://order/groovyScripts/order/test/TestCustRequestPermissionCheck.groovy"/> + </test-case> </test-suite> |
Free forum by Nabble | Edit this page |