When the MPLModule or any other script loads - it can override the registerAllowedMethod with included vars steps Global Vars. This behavior don't allow to mock the custom steps we don't need to test.
Proposed way to fix: override function registerAllowedMethod(MethodSignature methodSignature, Closure closure) and check existence of such allowed method by isMethodAllowed before adding the data to allowedMethodCallbacks. This function is used by the internal helper setGlobalVars and with changes will not allow to override already set mocks.
Also it will be possible to override the allowed methods manually using registerAllowedMethod(String name, List<Class> args = [], Closure closure) helper method.
When the MPLModule or any other script loads - it can override the
registerAllowedMethod
with includedvars
stepsGlobal Vars
. This behavior don't allow to mock the custom steps we don't need to test.Proposed way to fix: override function
registerAllowedMethod(MethodSignature methodSignature, Closure closure)
and check existence of such allowed method byisMethodAllowed
before adding the data toallowedMethodCallbacks
. This function is used by the internal helpersetGlobalVars
and with changes will not allow to override already set mocks. Also it will be possible to override the allowed methods manually usingregisterAllowedMethod(String name, List<Class> args = [], Closure closure)
helper method.