1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Mark GrantedAuthority#getAuthority as @Nullable

Closes: gh-17999

Signed-off-by: Andrey Litvitski <andrey1010102008@gmail.com>
This commit is contained in:
Andrey Litvitski
2025-10-11 18:42:33 +03:00
committed by Josh Cummings
parent eb43830260
commit 9b61533db2
6 changed files with 15 additions and 7 deletions
@@ -281,7 +281,8 @@ public final class SecurityMockMvcResultMatchers {
for (String role : roles) {
withPrefix.add(new SimpleGrantedAuthority(rolePrefix + role));
}
this.ignoreAuthorities = (authority) -> !authority.getAuthority().startsWith(rolePrefix);
this.ignoreAuthorities = (authority) -> (authority.getAuthority() != null
&& !authority.getAuthority().startsWith(rolePrefix));
return withAuthorities(withPrefix);
}