@Test public void constructorWhenUserServiceIsNullThenThrowIllegalArgumentException() { this.exception.expect(IllegalArgumentException.class); new OidcAuthorizationCodeAuthenticationProvider(this.accessTokenResponseClient, null); }
@Test public void constructorWhenAccessTokenResponseClientIsNullThenThrowIllegalArgumentException() { this.exception.expect(IllegalArgumentException.class); new OidcAuthorizationCodeAuthenticationProvider(null, this.userService); }
@Before @SuppressWarnings("unchecked") public void setUp() { this.clientRegistration = clientRegistration().clientId("client1").build(); this.authorizationRequest = request().scope("openid", "profile", "email").build(); this.authorizationResponse = success().build(); this.authorizationExchange = new OAuth2AuthorizationExchange(this.authorizationRequest, this.authorizationResponse); this.accessTokenResponseClient = mock(OAuth2AccessTokenResponseClient.class); this.accessTokenResponse = this.accessTokenSuccessResponse(); this.userService = mock(OAuth2UserService.class); this.authenticationProvider = new OidcAuthorizationCodeAuthenticationProvider(this.accessTokenResponseClient, this.userService); when(this.accessTokenResponseClient.getTokenResponse(any())).thenReturn(this.accessTokenResponse); }
new OidcAuthorizationCodeAuthenticationProvider(accessTokenResponseClient, oidcUserService); JwtDecoderFactory<ClientRegistration> jwtDecoderFactory = this.getJwtDecoderFactoryBean(); if (jwtDecoderFactory != null) {
new OidcAuthorizationCodeAuthenticationProvider(accessTokenResponseClient, oidcUserService); if (userAuthoritiesMapper != null) { oidcAuthorizationCodeAuthenticationProvider.setAuthoritiesMapper(userAuthoritiesMapper);
new OidcAuthorizationCodeAuthenticationProvider(accessTokenResponseClient, oidcUserService); if (userAuthoritiesMapper != null) { oidcAuthorizationCodeAuthenticationProvider.setAuthoritiesMapper(userAuthoritiesMapper);