private IExpectationSetters<?> expectAuth(Set<String> roles, boolean allowed)
throws AuthFailedException {
if (!allowed) {
return expect(userValidator.checkAuthenticated(SESSION, roles))
.andThrow(new AuthFailedException("Denied!"));
} else {
return expect(userValidator.checkAuthenticated(SESSION, roles))
.andReturn(context);
}
}