public void testAuthorizedUser() throws Exception {
UserRoleAuthorizationInterceptor interceptor = new UserRoleAuthorizationInterceptor();
String validRole = "allowed";
interceptor.setAuthorizedRoles(new String[] {validRole});
MockRenderRequest request = new MockRenderRequest();
MockRenderResponse response = new MockRenderResponse();
Object handler = new Object();
request.addUserRole(validRole);
assertTrue(request.isUserInRole(validRole));
boolean shouldProceed = interceptor.preHandle(request, response, handler);
assertTrue(shouldProceed);