SEC-717: Resolve UserDetails.getAuthorities() sort logic issue.

This commit is contained in:
Ben Alex 2008-03-16 04:49:05 +00:00
parent c5f63d00cc
commit 7d6c858b1d
1 changed files with 4 additions and 4 deletions

View File

@ -171,8 +171,8 @@ public class ResinAcegiAuthenticatorTests extends TestCase {
PrincipalSpringSecurityUserToken castResult = (PrincipalSpringSecurityUserToken) result; PrincipalSpringSecurityUserToken castResult = (PrincipalSpringSecurityUserToken) result;
assertEquals("rod", castResult.getPrincipal()); assertEquals("rod", castResult.getPrincipal());
assertEquals("koala", castResult.getCredentials()); assertEquals("koala", castResult.getCredentials());
assertEquals("ROLE_TELLER", castResult.getAuthorities()[0].getAuthority()); assertEquals("ROLE_TELLER", castResult.getAuthorities()[1].getAuthority());
assertEquals("ROLE_SUPERVISOR", castResult.getAuthorities()[1].getAuthority()); assertEquals("ROLE_SUPERVISOR", castResult.getAuthorities()[0].getAuthority());
assertEquals(ADAPTER_KEY.hashCode(), castResult.getKeyHash()); assertEquals(ADAPTER_KEY.hashCode(), castResult.getKeyHash());
} }
@ -192,8 +192,8 @@ public class ResinAcegiAuthenticatorTests extends TestCase {
PrincipalSpringSecurityUserToken castResult = (PrincipalSpringSecurityUserToken) result; PrincipalSpringSecurityUserToken castResult = (PrincipalSpringSecurityUserToken) result;
assertEquals("rod", castResult.getPrincipal()); assertEquals("rod", castResult.getPrincipal());
assertEquals("koala", castResult.getCredentials()); assertEquals("koala", castResult.getCredentials());
assertEquals("ROLE_TELLER", castResult.getAuthorities()[0].getAuthority()); assertEquals("ROLE_TELLER", castResult.getAuthorities()[1].getAuthority());
assertEquals("ROLE_SUPERVISOR", castResult.getAuthorities()[1].getAuthority()); assertEquals("ROLE_SUPERVISOR", castResult.getAuthorities()[0].getAuthority());
assertEquals(ADAPTER_KEY.hashCode(), castResult.getKeyHash()); assertEquals(ADAPTER_KEY.hashCode(), castResult.getKeyHash());
} }