A unit test mixin for Interceptor instances
Constructor and description |
---|
InterceptorUnitTestMixin
(java.util.Set<java.lang.String> features) |
InterceptorUnitTestMixin
() |
Type Params | Return Type | Name and description |
---|---|---|
|
protected GrailsInterceptorHandlerInterceptorAdapter |
getHandlerInterceptor() |
|
Interceptor |
mockInterceptor(java.lang.Class<? extends groovy.lang.Interceptor> interceptorClass) Mock the interceptor for the given name |
|
java.lang.Object |
withInterceptors(java.util.Map<java.lang.String, java.lang.Object> arguments, groovy.lang.Closure callable) Execute the given request with the registered interceptors |
|
UrlMappingInfo |
withRequest(java.util.Map<java.lang.String, java.lang.Object> arguments) Allows testing of the interceptor directly by setting up an incoming request that can be matched prior to invoking the interceptor |
Methods inherited from class | Name |
---|---|
class ControllerUnitTestMixin |
createAndEnhance, getFlash, getGroovyPages, getModel, getParams, getRequest, getResponse, getServletContext, getSession, getStatus, getView, getViews, getWebRequest, mockCommandObject, mockController, testFor |
class GrailsUnitTestMixin |
defineBeans, getApplicationContext, getConfig, getGrailsApplication, getMainContext, getMessageSource, mockCodec, shouldFail, shouldFail |
class TestMixinRuntimeSupport |
getFeatures, getRuntime, setRuntime, setTestClass |
class groovy.lang.GroovyObjectSupport |
groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll() |
Mock the interceptor for the given name
interceptorClass
- The interceptor classExecute the given request with the registered interceptors
arguments
- The argumentscallable
- A callable containing an invocation of a controller actionAllows testing of the interceptor directly by setting up an incoming request that can be matched prior to invoking the interceptor
arguments
- Named arguments specifying the controller/action or URI that interceptor should match