how do i mock this?
i thought it would but it doesn'tCode:public static UserDetails getUserFromSecurityContext() { return (UserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); }
i'm doing auth'ing against an ldap server.Code:GrantedAuthority[] ga = new GrantedAuthority[] {new GrantedAuthorityImpl("ROLE_ADS_ADMIN")}; TestingAuthenticationToken token = new TestingAuthenticationToken("admin", "password", ga); token.setAuthenticated(true); SecurityContextHolder.getContext().setAuthentication(token);
having a chapter in the docs on testing would be nice.
thx


