Skip to content

Commit 36c33b6

Browse files
committed
uncouple OAuthRequest and Service
1 parent ab828cf commit 36c33b6

62 files changed

Lines changed: 229 additions & 121 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

changelog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[SNAPSHOT]
2+
* uncouple OAuthRequest and Service. OAuthRequest shouldn't know anything about OAuthservice.
3+
You don't need OAuthService to create OAuthRequest anymore. Async request should be sent via OAuthService method.
4+
15
[3.3.0]
26
* update Facebook v2.6 -> v2.8
37
* add The Things Network API (v1-staging and v2-preview) (thanks to https://github.com/jpmeijers)

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/AWeberExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static void main(String... args) throws IOException {
5656

5757
// Now let's go and ask for a protected resource!
5858
System.out.println("Now we're going to access a protected resource...");
59-
final OAuthRequest request = new OAuthRequest(Verb.GET, ACCOUNT_RESOURCE_URL, service);
59+
final OAuthRequest request = new OAuthRequest(Verb.GET, ACCOUNT_RESOURCE_URL, service.getConfig());
6060
service.signRequest(accessToken, request);
6161
final Response response = request.send();
6262
System.out.println("Got it! Lets see what we found...");

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/Box20Example.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static void main(String... args) throws IOException {
7676

7777
// Now let's go and ask for a protected resource!
7878
System.out.println("Now we're going to access a protected resource...");
79-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service);
79+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service.getConfig());
8080
service.signRequest(accessToken, request);
8181
final Response response = request.send();
8282
System.out.println("Got it! Lets see what we found...");

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/DiggExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static void main(String... args) throws IOException {
5959

6060
// Now let's go and ask for a protected resource!
6161
System.out.println("Now we're going to access a protected resource...");
62-
final OAuthRequest request = new OAuthRequest(Verb.POST, PROTECTED_RESOURCE_URL, service);
62+
final OAuthRequest request = new OAuthRequest(Verb.POST, PROTECTED_RESOURCE_URL, service.getConfig());
6363
request.addBodyParameter("comment_id", "20100729223726:4fef610331ee46a3b5cbd740bf71313e");
6464
service.signRequest(accessToken, request);
6565
final Response response = request.send();

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/FacebookAsyncNingExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ public static void main(String... args) throws InterruptedException, ExecutionEx
8484

8585
// Now let's go and ask for a protected resource!
8686
System.out.println("Now we're going to access a protected resource...");
87-
final OAuthRequestAsync request = new OAuthRequestAsync(Verb.GET, PROTECTED_RESOURCE_URL, service);
87+
final OAuthRequestAsync request = new OAuthRequestAsync(Verb.GET, PROTECTED_RESOURCE_URL);
8888
service.signRequest(accessToken, request);
89-
final Response response = request.sendAsync(null).get();
89+
final Response response = service.execute(request, null).get();
9090
System.out.println("Got it! Lets see what we found...");
9191
System.out.println();
9292
System.out.println(response.getCode());

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/FacebookExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static void main(String... args) throws IOException {
6969

7070
// Now let's go and ask for a protected resource!
7171
System.out.println("Now we're going to access a protected resource...");
72-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service);
72+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service.getConfig());
7373
service.signRequest(accessToken, request);
7474
final Response response = request.send();
7575
System.out.println("Got it! Lets see what we found...");

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/FlickrExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static void main(String... args) throws IOException {
5555

5656
// Now let's go and ask for a protected resource!
5757
System.out.println("Now we're going to access a protected resource...");
58-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service);
58+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service.getConfig());
5959
request.addQuerystringParameter("method", "flickr.test.login");
6060
service.signRequest(accessToken, request);
6161
final Response response = request.send();

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/Foursquare2Example.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static void main(String... args) throws IOException {
5454
// Now let's go and ask for a protected resource!
5555
System.out.println("Now we're going to access a protected resource...");
5656
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL + accessToken.getAccessToken(),
57-
service);
57+
service.getConfig());
5858
service.signRequest(accessToken, request);
5959
final Response response = request.send();
6060
System.out.println("Got it! Lets see what we found...");

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/FoursquareExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static void main(String... args) throws IOException {
5151

5252
// Now let's go and ask for a protected resource!
5353
System.out.println("Now we're going to access a protected resource...");
54-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service);
54+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service.getConfig());
5555
service.signRequest(accessToken, request);
5656
final Response response = request.send();
5757
System.out.println("Got it! Lets see what we found...");

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/FreelancerExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static void main(String... args) throws IOException {
5959

6060
// Now let's go and ask for a protected resource!
6161
System.out.println("Now we're going to access a protected resource...");
62-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service);
62+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL, service.getConfig());
6363
service.signRequest(accessToken, request);
6464
request.addHeader("GData-Version", "3.0");
6565
final Response response = request.send();

0 commit comments

Comments
 (0)