Package org.agorava.api.oauth

Examples of org.agorava.api.oauth.Token


    @Test
    public void shouldExtractTokenFromOAuthStandardResponse() {
        String response = "access_token=166942940015970|2.2ltzWXYNDjCtg5ZDVVJJeg__.3600" +
                ".1295816400-548517159|RsXNdKrpxg8L6QNLWcs2TVTmcaE";
        Token extracted = extractor.extract(response);
        assertEquals("166942940015970|2.2ltzWXYNDjCtg5ZDVVJJeg__.3600.1295816400-548517159|RsXNdKrpxg8L6QNLWcs2TVTmcaE",
                extracted.getToken());
        assertEquals("", extracted.getSecret());
    }
View Full Code Here


    @Test
    public void shouldExtractTokenFromResponseWithExpiresParam() {
        String response = "access_token=166942940015970|2.2ltzWXYNDjCtg5ZDVVJJeg__.3600" +
                ".1295816400-548517159|RsXNdKrpxg8L6QNLWcs2TVTmcaE&expires=5108";
        Token extracted = extractor.extract(response);
        assertEquals("166942940015970|2.2ltzWXYNDjCtg5ZDVVJJeg__.3600.1295816400-548517159|RsXNdKrpxg8L6QNLWcs2TVTmcaE",
                extracted.getToken());
        assertEquals("", extracted.getSecret());
    }
View Full Code Here

    }

    @Test
    public void shouldExtractTokenFromResponseWithManyParameters() {
        String response = "access_token=foo1234&other_stuff=yeah_we_have_this_too&number=42";
        Token extracted = extractor.extract(response);
        assertEquals("foo1234", extracted.getToken());
        assertEquals("", extracted.getSecret());
    }
View Full Code Here

    private JsonTokenExtractor extractor = new JsonTokenExtractor();

    @Test
    public void shouldParseResponse() {
        Token token = extractor.extract(response);
        Assert.assertEquals(token.getToken(), "I0122HHJKLEM21F3WLPYHDKGKZULAUO4SGMV3ABKFTDT3T3X");
    }
View Full Code Here

    }

    @Test
    public void shouldExtractTokenFromOAuthStandardResponse() {
        String response = "oauth_token=hh5s93j4hdidpola&oauth_token_secret=hdhd0244k9j7ao03";
        Token extracted = extractor.extract(response);
        assertEquals("hh5s93j4hdidpola", extracted.getToken());
        assertEquals("hdhd0244k9j7ao03", extracted.getSecret());
    }
View Full Code Here

    }

    @Test
    public void shouldExtractTokenFromInvertedOAuthStandardResponse() {
        String response = "oauth_token_secret=hh5s93j4hdidpola&oauth_token=hdhd0244k9j7ao03";
        Token extracted = extractor.extract(response);
        assertEquals("hh5s93j4hdidpola", extracted.getSecret());
        assertEquals("hdhd0244k9j7ao03", extracted.getToken());
    }
View Full Code Here

    }

    @Test
    public void shouldExtractTokenFromResponseWithCallbackConfirmed() {
        String response = "oauth_token=hh5s93j4hdidpola&oauth_token_secret=hdhd0244k9j7ao03&callback_confirmed=true";
        Token extracted = extractor.extract(response);
        assertEquals("hh5s93j4hdidpola", extracted.getToken());
        assertEquals("hdhd0244k9j7ao03", extracted.getSecret());
    }
View Full Code Here

    }

    @Test
    public void shouldExtractTokenWithEmptySecret() {
        String response = "oauth_token=hh5s93j4hdidpola&oauth_token_secret=";
        Token extracted = extractor.extract(response);
        assertEquals("hh5s93j4hdidpola", extracted.getToken());
        assertEquals("", extracted.getSecret());
    }
View Full Code Here

TOP

Related Classes of org.agorava.api.oauth.Token

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.