@Test public void shouldGetAnAccessTokenUsingGET() throws Exception { OAuthInterface mockOAuthInterface = mockGetOAuthInterface(); OAuthToken actual = newToTest(GET, mockOAuthInterface).getAccessToken(token, verifier); assertEquals(mockOAuthToken, actual); verify(mockOAuthInterface).getAccessToken( token.getToken(), signatureMethod, timestamp, nonce, version, verifier, "rcFomzZTgPWGoiQov%2FNHOa0mvwE%3D"); }
public OAuthToken getAccessToken(OAuthToken requestOAuthToken, String verifier) throws Exception { List<EncodedPair> oauthPairs = oauth(variantProvider, requestOAuthToken, methodType, accessTokenPath, EMPTY_HTTP_PAIRS, pair("oauth_verifier", verifier)); Map<String,String> params = asMap(oauthPairs); return oauthInterface.getAccessToken( params.get("oauth_consumer_key"), params.get("oauth_signature_method"), params.get("oauth_timestamp"), params.get("oauth_nonce"), params.get("oauth_version"), params.get("oauth_verifier"), params.get("oauth_signature") ); }
OAuthApiV1 implements OAuthApi { public OAuthToken getAccessToken(OAuthToken requestOAuthToken, String verifier) throws Exception { List<EncodedPair> oauthPairs = oauth(variantProvider, requestOAuthToken, methodType, accessTokenPath, EMPTY_HTTP_PAIRS, pair("oauth_verifier", verifier)); Map<String,String> params = asMap(oauthPairs); return oauthInterface.getAccessToken( params.get("oauth_consumer_key"), params.get("oauth_signature_method"), params.get("oauth_timestamp"), params.get("oauth_nonce"), params.get("oauth_version"), params.get("oauth_verifier"), params.get("oauth_signature") ); } }
OAuthApiV1 implements OAuthApi { public OAuthToken getAccessToken(OAuthToken requestOAuthToken, String verifier) throws Exception { List<EncodedPair> oauthPairs = oauth(variantProvider, requestOAuthToken, methodType, accessTokenPath, EMPTY_HTTP_PAIRS, pair("oauth_verifier", verifier)); Map<String,String> params = asMap(oauthPairs); return oauthInterface.getAccessToken( params.get("oauth_consumer_key"), params.get("oauth_signature_method"), params.get("oauth_timestamp"), params.get("oauth_nonce"), params.get("oauth_version"), params.get("oauth_verifier"), params.get("oauth_signature") ); } OAuthApiV1(MethodType methodType, String oauthEndPoint, String requestTokenPath, String accessTokenPath, String refreshAccessTokenPath, OAuthInterface oauthInterface, OAuthToken consumerToken, VariantProvider variantProvider); }
OAuthApiV1 implements OAuthApi { public OAuthToken getAccessToken(OAuthToken requestOAuthToken, String verifier) throws Exception { List<EncodedPair> oauthPairs = oauth(variantProvider, requestOAuthToken, methodType, accessTokenPath, EMPTY_HTTP_PAIRS, pair("oauth_verifier", verifier)); Map<String,String> params = asMap(oauthPairs); return oauthInterface.getAccessToken( params.get("oauth_consumer_key"), params.get("oauth_signature_method"), params.get("oauth_timestamp"), params.get("oauth_nonce"), params.get("oauth_version"), params.get("oauth_verifier"), params.get("oauth_signature") ); } OAuthApiV1(MethodType methodType, String oauthEndPoint, String requestTokenPath, String accessTokenPath, String refreshAccessTokenPath, OAuthInterface oauthInterface, OAuthToken consumerToken, VariantProvider variantProvider); OAuthToken getRequestToken(); OAuthToken getAccessToken(OAuthToken requestOAuthToken, String verifier); OAuthToken refreshAccessToken(OAuthToken token); }
OAuthApiV1 implements OAuthApi { public OAuthToken getAccessToken(OAuthToken requestOAuthToken, String verifier) throws Exception { List<EncodedPair> oauthPairs = oauth(variantProvider, requestOAuthToken, methodType, accessTokenPath, EMPTY_HTTP_PAIRS, pair("oauth_verifier", verifier)); Map<String,String> params = asMap(oauthPairs); return oauthInterface.getAccessToken( params.get("oauth_consumer_key"), params.get("oauth_signature_method"), params.get("oauth_timestamp"), params.get("oauth_nonce"), params.get("oauth_version"), params.get("oauth_verifier"), params.get("oauth_signature") ); } OAuthApiV1(MethodType methodType, String oauthEndPoint, String requestTokenPath, String accessTokenPath, String refreshAccessTokenPath, OAuthInterface oauthInterface, OAuthToken consumerToken, VariantProvider variantProvider); OAuthToken getRequestToken(); OAuthToken getAccessToken(OAuthToken requestOAuthToken, String verifier); OAuthToken refreshAccessToken(OAuthToken token);  }