@Trait @CompileStatic trait InterceptorUnitTest<T> extends Object implements GrailsWebUnitTest, ParameterizedGrailsUnitTest<T>
| Type Params | Return Type | Name and description |
|---|---|---|
|
String |
getBeanName(Class<?> interceptorClass) |
|
T |
getInterceptor() |
|
void |
mockArtefact(Class<?> interceptorClass) |
|
Interceptor |
mockInterceptor(Class<?> interceptorClass)Mock the interceptor for the given name |
|
Object |
withInterceptors(Map<String, Object> arguments, Closure callable)Execute the given request with the registered interceptors |
|
UrlMappingInfo |
withRequest(Map<String, Object> arguments)Allows testing of the interceptor directly by setting up an incoming request that can be matched prior to invoking the interceptor |
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