Author: surajk
Date: Sat Jan 12 08:39:11 2019 New Revision: 1851154 URL: http://svn.apache.org/viewvc?rev=1851154&view=rev Log: Added:Unit test case for service - updatePaymentGatewayConfig. (OFBIZ-9115) Thanks Deepak Nigam for reporting and Yogesh Naroliya for providing the updated patch. Added: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentGatewayTests.groovy (with props) Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/accountingtests.xml Added: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentGatewayTests.groovy URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentGatewayTests.groovy?rev=1851154&view=auto ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentGatewayTests.groovy (added) +++ ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentGatewayTests.groovy Sat Jan 12 08:39:11 2019 @@ -0,0 +1,39 @@ +/******************************************************************************* + * 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 AutoAcctgPaymentGatewayTests extends GroovyScriptTestCase { + void testUpdatePaymentGatewayConfig() { + Map serviceCtx = [:] + serviceCtx.paymentGatewayConfigId = 'SAGEPAY_asdfCONFIG' + serviceCtx.description = 'Test Payment Gateway Config Id' + serviceCtx.userLogin = EntityQuery.use(delegator).from('UserLogin').where('userLoginId', 'system').cache().queryOne() + Map serviceResult = dispatcher.runSync('updatePaymentGatewayConfig', serviceCtx) + assert ServiceUtil.isSuccess(serviceResult) + + GenericValue paymentGatewayConfig = EntityQuery.use(delegator).from('PaymentGatewayConfig').where('paymentGatewayConfigId', 'SAGEPAY_CONFIG').queryOne() + assert paymentGatewayConfig + assert paymentGatewayConfig.description == 'Test Payment Gateway Config Id' + } +} Propchange: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentGatewayTests.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentGatewayTests.groovy ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/test/AutoAcctgPaymentGatewayTests.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/accountingtests.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/accountingtests.xml?rev=1851154&r1=1851153&r2=1851154&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/accountingtests.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/accounting/testdef/accountingtests.xml Sat Jan 12 08:39:11 2019 @@ -60,4 +60,7 @@ <test-case case-name="auto-accounting-payment-tests"> <groovy-test-suite location="component://accounting/groovyScripts/test/AutoAcctgPaymentTests.groovy"/> </test-case> + <test-case case-name="auto-accounting-paymentgateway-tests"> + <groovy-test-suite location="component://accounting/groovyScripts/test/AutoAcctgPaymentGatewayTests.groovy"/> + </test-case> </test-suite> |
Free forum by Nabble | Edit this page |