How to test session attribute set in Interceptor

7 views
Skip to first unread message

Niels Jørgen Bagger

unread,
Jun 27, 2017, 1:19:28 PM6/27/17
to Grails Dev Discuss
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?
Reply all
Reply to author
Forward
0 new messages