mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-31 01:02:14 +00:00
Fix ClassCastException for JDK 9+
AuthenticationPrincipalArgumentResolverTests failed in JDK 9+ due to its improved generic support and a ClassCastException. Issue gh-7363
This commit is contained in:
parent
ceab56f764
commit
45a1490d5d
@ -83,7 +83,7 @@ public class AuthenticationPrincipalArgumentResolverTests {
|
||||
@Test
|
||||
public void resolveArgumentWhenExpressionThenFound() {
|
||||
Authentication authentication = TestAuthentication.authenticatedUser();
|
||||
Mono<UserDetails> result = (Mono<UserDetails>) this.resolver.resolveArgument(arg0("authenticationPrincipalExpression"), null)
|
||||
Mono<String> result = (Mono<String>) this.resolver.resolveArgument(arg0("authenticationPrincipalExpression"), null)
|
||||
.subscriberContext(ReactiveSecurityContextHolder.withAuthentication(authentication))
|
||||
.block();
|
||||
assertThat(result.block()).isEqualTo(authentication.getName());
|
||||
|
Loading…
x
Reference in New Issue
Block a user