RolePreprocessingMapper extends LdapUserDetailsMapper implements InitializingBean { @Override protected GrantedAuthority createAuthority( final Object role ) { Object newRole = preprocessRole( role ); return super.createAuthority( newRole ); } RolePreprocessingMapper();  RolePreprocessingMapper( final String tokenName ); void setTokenName( final String tokenName ); String getTokenName(); void afterPropertiesSet();  }
@Test public void testCreateAuthority() throws Exception { roleMapper.setTokenName( "token" ); assertEquals( "token", roleMapper.getTokenName() ); assertNull( roleMapper.createAuthority( null ) ); }