This commit is contained in:
Luke Taylor 2009-07-13 23:12:32 +00:00
parent 5d389d953d
commit 1ca2e6e6fc
1 changed files with 1 additions and 2 deletions

View File

@ -14,13 +14,12 @@ import org.springframework.security.core.Authentication;
* @version $Id$ * @version $Id$
*/ */
public class RoleVoterTests { public class RoleVoterTests {
// Vote on attribute list that has two attributes A and C (i.e. one matching)
@Test @Test
public void oneMatchingAttributeGrantsAccess() { public void oneMatchingAttributeGrantsAccess() {
RoleVoter voter = new RoleVoter(); RoleVoter voter = new RoleVoter();
voter.setRolePrefix(""); voter.setRolePrefix("");
Authentication userAB = new TestingAuthenticationToken("user","pass", "A", "B"); Authentication userAB = new TestingAuthenticationToken("user","pass", "A", "B");
// Vote on attribute list that has two attributes A and C (i.e. only one matching)
assertEquals(AccessDecisionVoter.ACCESS_GRANTED, voter.vote(userAB, this, SecurityConfig.createList("A","C"))); assertEquals(AccessDecisionVoter.ACCESS_GRANTED, voter.vote(userAB, this, SecurityConfig.createList("A","C")));
} }
} }