I have a own defined annotation (@BasicAuth) that I use for adding BasicAuth to a method.
Like this:
public class TokenController extends BaseController {
@BasicAuth
public static Result create() {
....
}
}
It works like a charm but when I’m testing the create method I would like to switch off (or mock) the protection. Is that possible?
Just create the
TokenControllerusingnew TokenController()and callcreate(). The annotation will be ignored because you’re creating it outside the framework.