Skip to content

Commit

Permalink
add a parameter 'oauthVerifier' to call Twitter#getOAuthAccessToken()
Browse files Browse the repository at this point in the history
  • Loading branch information
komiya-atsushi committed Apr 20, 2013
1 parent d44b0b0 commit 995a7c0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions twitter4j-core/src/test/java/twitter4j/auth/OAuthTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ public void testSigninWithTwitter() throws Exception {
response = http.request(new HttpRequest(RequestMethod.POST, authorizeURL, params, null, props));

// response = http.post(authorizeURL, params);
at = twitter.getOAuthAccessToken(rt);
resStr = response.asString();
String oauthVerifier = catchPattern(resStr, "&oauth_verifier=", "\">");

at = twitter.getOAuthAccessToken(rt, oauthVerifier);
assertEquals(at.getScreenName(), id1.screenName);
assertEquals(at.getUserId(), id1.id);

Expand Down Expand Up @@ -217,7 +220,10 @@ public void testBrowserClient() throws Exception {
params[2] = new HttpParameter("session[username_or_email]", id1.screenName);
params[3] = new HttpParameter("session[password]", id1.password);
response = http.request(new HttpRequest(RequestMethod.POST, authorizeURL, params, null, props));
at = twitter.getOAuthAccessToken(rt);
resStr = response.asString();
String oauthVerifier = catchPattern(resStr, "&oauth_verifier=", "\">");

at = twitter.getOAuthAccessToken(rt, oauthVerifier);
assertEquals(at.getScreenName(), id1.screenName);
assertEquals(at.getUserId(), id1.id);

Expand Down

0 comments on commit 995a7c0

Please sign in to comment.