1
0
mirror of synced 2026-08-05 17:57:15 +00:00

SEC-1418: Deprecate GrantedAuthorityImpl in favour of final SimpleGrantedAuthority.

It should be noted that equality checks or lookups with Strings or other authority types will now fail where they would have succeeded before.
This commit is contained in:
Luke Taylor
2010-12-03 16:41:46 +00:00
parent 978b7d4707
commit 4a40d80da1
45 changed files with 380 additions and 414 deletions
@@ -1,14 +1,6 @@
package org.springframework.security.performance;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.*;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
@@ -18,7 +10,7 @@ import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.GrantedAuthorityImpl;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.web.FilterChainProxy;
import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
@@ -26,6 +18,9 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.StopWatch;
import javax.servlet.http.HttpSession;
import java.util.*;
/**
*
* @author Luke Taylor
@@ -122,7 +117,7 @@ public class FilterChainPerformanceTests {
GrantedAuthority[] roles = new GrantedAuthority[howMany];
for (int i = howMany - 1; i >=0 ; i--) {
roles[i] = new GrantedAuthorityImpl("ROLE_" + i);
roles[i] = new SimpleGrantedAuthority("ROLE_" + i);
}
return Arrays.asList(roles);