Search in sources :

Example 56 with OAuthRequest

use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.

the class ObjectMother method createSampleOAuthRequestPort443v2.

public static OAuthRequest createSampleOAuthRequestPort443v2() {
    final OAuthRequest request = new OAuthRequest(Verb.GET, "https://example.com:443/test");
    request.addOAuthParameter(OAuthConstants.TIMESTAMP, "123456");
    request.addOAuthParameter(OAuthConstants.CONSUMER_KEY, "AS#$^*@&");
    request.addOAuthParameter(OAuthConstants.CALLBACK, "http://example/callback");
    request.addOAuthParameter(OAuthConstants.SIGNATURE, "OAuth-Signature");
    return request;
}
Also used : OAuthRequest(com.github.scribejava.core.model.OAuthRequest)

Example 57 with OAuthRequest

use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.

the class ObjectMother method createSampleOAuthRequestPort8080.

public static OAuthRequest createSampleOAuthRequestPort8080() {
    final OAuthRequest request = new OAuthRequest(Verb.GET, "http://example.com:8080");
    request.addOAuthParameter(OAuthConstants.TIMESTAMP, "123456");
    request.addOAuthParameter(OAuthConstants.CONSUMER_KEY, "AS#$^*@&");
    request.addOAuthParameter(OAuthConstants.CALLBACK, "http://example/callback");
    request.addOAuthParameter(OAuthConstants.SIGNATURE, "OAuth-Signature");
    return request;
}
Also used : OAuthRequest(com.github.scribejava.core.model.OAuthRequest)

Example 58 with OAuthRequest

use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.

the class ObjectMother method createSampleOAuthRequestPort443.

public static OAuthRequest createSampleOAuthRequestPort443() {
    final OAuthRequest request = new OAuthRequest(Verb.GET, "https://example.com:443");
    request.addOAuthParameter(OAuthConstants.TIMESTAMP, "123456");
    request.addOAuthParameter(OAuthConstants.CONSUMER_KEY, "AS#$^*@&");
    request.addOAuthParameter(OAuthConstants.CALLBACK, "http://example/callback");
    request.addOAuthParameter(OAuthConstants.SIGNATURE, "OAuth-Signature");
    return request;
}
Also used : OAuthRequest(com.github.scribejava.core.model.OAuthRequest)

Example 59 with OAuthRequest

use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.

the class BaseStringExtractorTest method shouldThrowExceptionIfRquestHasNoOAuthParameters.

@Test(expected = OAuthParametersMissingException.class)
public void shouldThrowExceptionIfRquestHasNoOAuthParameters() {
    final OAuthRequest request = new OAuthRequest(Verb.GET, "http://example.com");
    extractor.extract(request);
}
Also used : OAuthRequest(com.github.scribejava.core.model.OAuthRequest) Test(org.junit.Test)

Example 60 with OAuthRequest

use of com.github.scribejava.core.model.OAuthRequest in project scribejava by scribejava.

the class HeaderExtractorTest method shouldExceptionIfRequestHasNoOAuthParams.

@Test(expected = OAuthParametersMissingException.class)
public void shouldExceptionIfRequestHasNoOAuthParams() {
    final OAuthRequest emptyRequest = new OAuthRequest(Verb.GET, "http://example.com");
    extractor.extract(emptyRequest);
}
Also used : OAuthRequest(com.github.scribejava.core.model.OAuthRequest) Test(org.junit.Test)

Aggregations

OAuthRequest (com.github.scribejava.core.model.OAuthRequest)107 Response (com.github.scribejava.core.model.Response)85 ServiceBuilder (com.github.scribejava.core.builder.ServiceBuilder)62 Scanner (java.util.Scanner)60 OAuth2AccessToken (com.github.scribejava.core.model.OAuth2AccessToken)48 OAuth20Service (com.github.scribejava.core.oauth.OAuth20Service)45 OAuth1AccessToken (com.github.scribejava.core.model.OAuth1AccessToken)21 OAuth1RequestToken (com.github.scribejava.core.model.OAuth1RequestToken)21 OAuth10aService (com.github.scribejava.core.oauth.OAuth10aService)20 Random (java.util.Random)16 OAuthConfig (com.github.scribejava.core.model.OAuthConfig)13 Test (org.junit.Test)11 HttpUrl (okhttp3.HttpUrl)9 MockResponse (okhttp3.mockwebserver.MockResponse)8 MockWebServer (okhttp3.mockwebserver.MockWebServer)8 IOException (java.io.IOException)6 HashMap (java.util.HashMap)6 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)6 DefaultApi20 (com.github.scribejava.core.builder.api.DefaultApi20)4 ExecutionException (java.util.concurrent.ExecutionException)4