Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2012-04-25 19:27:28 -0400
committerKevin Sawicki2012-04-25 19:27:28 -0400
commit2af7e007686a898e511bbb7dc21c6948bb358f2f (patch)
treed55736598907f2c5b0da668a429d55b846bf320d
parent1337b6d25b1d4c1ecb55f712e839c5dbcb4faf44 (diff)
downloadegit-github-2af7e007686a898e511bbb7dc21c6948bb358f2f.tar.gz
egit-github-2af7e007686a898e511bbb7dc21c6948bb358f2f.tar.xz
egit-github-2af7e007686a898e511bbb7dc21c6948bb358f2f.zip
Call pageGists from getGists
This ensures the paging logic is exercised when all pages are directly read and follows the pattern used in other service classes. Change-Id: Iacb25a1bcd36c16e6d999f60b5ba3a42575673b6
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java2
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/GistService.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java
index abc59384..b88f31c9 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java
@@ -518,6 +518,8 @@ public class GistServiceTest {
PageIterator<Gist> iterator = gistService.pageGists("user");
assertNotNull(iterator);
assertTrue(iterator.hasNext());
+ assertEquals(Utils.page("/users/user/gists"), iterator.getRequest()
+ .generateUri());
}
/**
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/GistService.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/GistService.java
index 393f801c..da048e64 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/GistService.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/GistService.java
@@ -170,9 +170,7 @@ public class GistService extends GitHubService {
* @throws IOException
*/
public List<Gist> getGists(String user) throws IOException {
- PagedRequest<Gist> request = createUserGistRequest(user, PAGE_FIRST,
- PAGE_SIZE);
- return getAll(request);
+ return getAll(pageGists(user));
}
/**

Back to the top