How to test session attribute set in Interceptor

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to test session attribute set in Interceptor

Niels Jørgen Bagger
I have a simple Interceptor that intercepts all requests:

package proxy.interceptors

import grails.util.Holders
import proxy.Principal


class ProxyInterceptor {

int order = HIGHEST_PRECEDENCE

ProxyInterceptor() {
matchAll()
}

boolean before() {
Principal principal = new Principal(Holders.config, request)
request.session.principal = principal

return true
}

}

How do a write a test, that tests that principal is actually set on the session?

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/6d10db8a-d087-4b83-b0f6-9f9271627c00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...