@Test public void shouldFinishOAuth1Acquisition() { final OAuthToken token = new OAuthToken("value", "secret"); final OAuth1ConnectionFactory<?> oauth1 = mock(OAuth1ConnectionFactory.class); final OAuth1Applicator applicator = new OAuth1Applicator(properties); when(locator.providerWithId("providerId")) .thenReturn(new OAuth1CredentialProvider<>("providerId", oauth1, applicator)); final OAuth1Operations operations = mock(OAuth1Operations.class); when(oauth1.getOAuthOperations()).thenReturn(operations); final ArgumentCaptor<AuthorizedRequestToken> requestToken = ArgumentCaptor .forClass(AuthorizedRequestToken.class); final OAuthToken accessToken = new OAuthToken("tokenValue", "tokenSecret"); @SuppressWarnings({"unchecked", "rawtypes"}) final Class<MultiValueMap<String, String>> multimapType = (Class) MultiValueMap.class; when(operations.exchangeForAccessToken(requestToken.capture(), isNull(multimapType))).thenReturn(accessToken); applicator.setAccessTokenSecretProperty("accessTokenSecretProperty"); applicator.setAccessTokenValueProperty("accessTokenValueProperty"); applicator.setConsumerKeyProperty("consumerKeyProperty"); applicator.setConsumerSecretProperty("consumerSecretProperty"); final CredentialFlowState flowState = new OAuth1CredentialFlowState.Builder().providerId("providerId") .token(token).returnUrl(URI.create("/ui#state")).verifier("verifier").build(); final CredentialFlowState finalFlowState = credentials.finishAcquisition(flowState, URI.create("https: final AuthorizedRequestToken capturedRequestToken = requestToken.getValue(); assertThat(capturedRequestToken.getValue()).isEqualTo("value"); assertThat(capturedRequestToken.getSecret()).isEqualTo("secret"); assertThat(capturedRequestToken.getVerifier()).isEqualTo("verifier"); assertThat(finalFlowState) .isEqualTo(new OAuth1CredentialFlowState.Builder().createFrom(flowState).accessToken(accessToken).build()); }
public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); }
Credentials { public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); } }
Credentials { public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); } @Autowired  Credentials(final CredentialProviderLocator credentialProviderLocator, final EncryptionComponent encryptionComponent,
        final DataManager dataManager); }
Credentials { public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); } @Autowired  Credentials(final CredentialProviderLocator credentialProviderLocator, final EncryptionComponent encryptionComponent,
        final DataManager dataManager); AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl); AcquisitionMethod acquisitionMethodFor(final String providerId); Connection apply(final Connection updatedConnection, final CredentialFlowState flowState); CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl); }
Credentials { public CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl) { final CredentialProvider credentialProvider = providerFrom(flowState); return credentialProvider.finish(flowState, baseUrl); } @Autowired  Credentials(final CredentialProviderLocator credentialProviderLocator, final EncryptionComponent encryptionComponent,
        final DataManager dataManager); AcquisitionFlow acquire(final String providerId, final URI baseUrl, final URI returnUrl); AcquisitionMethod acquisitionMethodFor(final String providerId); Connection apply(final Connection updatedConnection, final CredentialFlowState flowState); CredentialFlowState finishAcquisition(final CredentialFlowState flowState, final URI baseUrl); static final String ACCESS_TOKEN_TAG; static final String ACCESS_TOKEN_URL_TAG; static final String AUTHENTICATION_TYPE_TAG; static final String AUTHENTICATION_URL_TAG; static final String AUTHORIZATION_URL_TAG; static final String AUTHORIZE_USING_PARAMETERS_TAG; static final String CLIENT_ID_TAG; static final String CLIENT_SECRET_TAG; static final String SCOPE_TAG; static final String TOKEN_STRATEGY_TAG; static final String ADDITIONAL_QUERY_PARAMETERS_TAG; }