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
|
@Test
|
||||||
public void resolveArgumentWhenExpressionThenFound() {
|
public void resolveArgumentWhenExpressionThenFound() {
|
||||||
Authentication authentication = TestAuthentication.authenticatedUser();
|
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))
|
.subscriberContext(ReactiveSecurityContextHolder.withAuthentication(authentication))
|
||||||
.block();
|
.block();
|
||||||
assertThat(result.block()).isEqualTo(authentication.getName());
|
assertThat(result.block()).isEqualTo(authentication.getName());
|
||||||
|
|
Loading…
Reference in New Issue