Moved scope inside OAuthConfig
This commit is contained in:
1 parent
41b6da1a44
commit
109c93b4e4
11 files changed
+32
-76
No files matched your search
@@ -57,19 +57,17 @@ public class ServiceBuilderTest
|
||||
builder.provider(ApiMock.class).apiKey("key").apiSecret("secret").scope("rss-api").build();
|
||||
assertEquals(ApiMock.config.getApiKey(), "key");
|
||||
assertEquals(ApiMock.config.getApiSecret(), "secret");
|
||||
assertEquals(ApiMock.scope, "rss-api");
|
||||
assertEquals(ApiMock.config.getScope(), "rss-api");
|
||||
}
|
||||
|
||||
public static class ApiMock implements Api
|
||||
{
|
||||
public static OAuthConfig config;
|
||||
public static String scope;
|
||||
|
||||
@Override
|
||||
public OAuthService createService(OAuthConfig config, String scope)
|
||||
public OAuthService createService(OAuthConfig config)
|
||||
{
|
||||
ApiMock.config = config;
|
||||
ApiMock.scope = scope;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,12 +12,14 @@ public class OAuthConfigTest
|
||||
{
|
||||
OAuthConfig config = new OAuthConfig("key", "secret");
|
||||
assertEquals(OAuthConstants.OUT_OF_BAND, config.getCallback());
|
||||
assertEquals(SignatureType.Header, config.getSignatureType());
|
||||
assertFalse(config.hasScope());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldOverrideDefaultsIfSet()
|
||||
{
|
||||
OAuthConfig config = new OAuthConfig("key", "secret", "http://callback");
|
||||
OAuthConfig config = new OAuthConfig("key", "secret", "http://callback", SignatureType.Header, "scope");
|
||||
assertEquals("http://callback", config.getCallback());
|
||||
assertEquals("key", config.getApiKey());
|
||||
assertEquals("secret", config.getApiSecret());
|
||||
|
||||
Reference in new issue
Block a user