1
0
mirror of synced 2026-05-22 13:23:17 +00:00

Authentication adds FactorGrantedAuthority

Closes gh-18001
This commit is contained in:
Rob Winch
2025-10-02 09:33:13 -05:00
parent ce36fc1e76
commit 3f74991ce9
9 changed files with 20 additions and 22 deletions
@@ -67,12 +67,10 @@ public class SecurityMockWithAuthoritiesMvcResultMatchersTests {
}
@Test
public void withAuthoritiesNotOrderSensitive() throws Exception {
List<SimpleGrantedAuthority> grantedAuthorities = new ArrayList<>();
grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_ADMIN"));
grantedAuthorities.add(new SimpleGrantedAuthority("ROLE_SELLER"));
grantedAuthorities.add(new SimpleGrantedAuthority(GrantedAuthorities.FACTOR_PASSWORD_AUTHORITY));
this.mockMvc.perform(formLogin()).andExpect(authenticated().withAuthorities(grantedAuthorities));
public void withAuthoritiesStringAllowsAnyOrderAndPermitsAnyImpl() throws Exception {
this.mockMvc.perform(formLogin())
.andExpect(authenticated().withAuthorities("ROLE_ADMIN", "ROLE_SELLER",
GrantedAuthorities.FACTOR_PASSWORD_AUTHORITY));
}
@Test