}
}
// Test fix to http://issues.appfuse.org/browse/APF-96
public void testAddUserRoleWhenHasAdminRole() throws Exception {
SecurityContext context = new SecurityContextImpl();
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("user",
"password",
new GrantedAuthority[] {new GrantedAuthorityImpl(Constants.ADMIN_ROLE)});
context.setAuthentication(token);
SecurityContextHolder.setContext(context);
UserManager userManager = (UserManager) makeInterceptedTarget();
User user = new User("user");
user.getRoles().add(new Role(Constants.ADMIN_ROLE));