Skip to content

Commit

Permalink
Fix ClassCastException for JDK 9+
Browse files Browse the repository at this point in the history
AuthenticationPrincipalArgumentResolverTests failed in JDK 9+ due to
its improved generic support and a ClassCastException.

Issue gh-7363
  • Loading branch information
rwinch committed Sep 24, 2019
1 parent ceab56f commit 45a1490
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private void currentUserOnMonoUserDetails(@CurrentUser Mono<UserDetails> user) {
@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());
Expand Down

0 comments on commit 45a1490

Please sign in to comment.