Search in sources :

Example 16 with OAuthConfig

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

the class ServiceBuilderTest method shouldAcceptASignatureType.

@Test
public void shouldAcceptASignatureType() {
    builder.apiKey("key").apiSecret("secret").signatureType(SignatureType.QueryString).build(api);
    final OAuthConfig config = api.getConfig();
    assertEquals(config.getApiKey(), "key");
    assertEquals(config.getApiSecret(), "secret");
    assertEquals(config.getSignatureType(), SignatureType.QueryString);
}
Also used : OAuthConfig(com.github.scribejava.core.model.OAuthConfig) Test(org.junit.Test)

Example 17 with OAuthConfig

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

the class ServiceBuilderTest method shouldReturnConfigDefaultValues.

@Test
public void shouldReturnConfigDefaultValues() {
    builder.apiKey("key").apiSecret("secret").build(api);
    final OAuthConfig config = api.getConfig();
    assertEquals(config.getApiKey(), "key");
    assertEquals(config.getApiSecret(), "secret");
    assertEquals(config.getCallback(), OAuthConstants.OUT_OF_BAND);
    assertEquals(config.getSignatureType(), SignatureType.Header);
}
Also used : OAuthConfig(com.github.scribejava.core.model.OAuthConfig) Test(org.junit.Test)

Example 18 with OAuthConfig

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

the class ServiceBuilderTest method shouldAcceptAnScope.

@Test
public void shouldAcceptAnScope() {
    builder.apiKey("key").apiSecret("secret").scope("rss-api").build(api);
    final OAuthConfig config = api.getConfig();
    assertEquals(config.getApiKey(), "key");
    assertEquals(config.getApiSecret(), "secret");
    assertEquals(config.getScope(), "rss-api");
}
Also used : OAuthConfig(com.github.scribejava.core.model.OAuthConfig) Test(org.junit.Test)

Aggregations

OAuthConfig (com.github.scribejava.core.model.OAuthConfig)18 OAuthRequest (com.github.scribejava.core.model.OAuthRequest)9 Test (org.junit.Test)4 Response (com.github.scribejava.core.model.Response)3 IOException (java.io.IOException)2 DefaultApi20 (com.github.scribejava.core.builder.api.DefaultApi20)1 HttpClient (com.github.scribejava.core.httpclient.HttpClient)1 OAuth1AccessToken (com.github.scribejava.core.model.OAuth1AccessToken)1 OAuth1RequestToken (com.github.scribejava.core.model.OAuth1RequestToken)1 OAuth20Service (com.github.scribejava.core.oauth.OAuth20Service)1 Map (java.util.Map)1 OkHttpClient (okhttp3.OkHttpClient)1 Before (org.junit.Before)1