{"action":"created","comment":{"url":"https://api.github.com/repos/ga4gh/compliance/pulls/comments/41158625","id":41158625,"diff_hunk":"@@ -0,0 +1,136 @@\n+package org.ga4gh.cts.api.reads;\n+\n+import org.apache.avro.AvroRemoteException;\n+import org.ga4gh.ctk.transport.URLMAPPING;\n+import org.ga4gh.ctk.transport.protocols.Client;\n+import org.ga4gh.cts.api.TestData;\n+import org.ga4gh.cts.api.Utils;\n+import org.ga4gh.methods.GAException;\n+import org.ga4gh.methods.SearchReadGroupSetsRequest;\n+import org.ga4gh.methods.SearchReadGroupSetsResponse;\n+import org.ga4gh.models.ReadAlignment;\n+import org.ga4gh.models.ReadGroupSet;\n+import org.junit.Test;\n+import org.junit.experimental.categories.Category;\n+\n+import java.util.HashSet;\n+import java.util.List;\n+import java.util.Set;\n+\n+import static org.assertj.core.api.Assertions.assertThat;\n+\n+/**\n+ * Test the <tt>/readgroupsets/search</tt> paging behavior.\n+ *\n+ * @author Herb Jellinek\n+ */\n+@Category(ReadsTests.class)\n+public class ReadGroupSetsPagingIT {\n+\n+    private static Client client = new Client(URLMAPPING.getInstance());\n+\n+    /**\n+     * Check that we can page 1 by 1 through the {@link ReadGroupSet}s\n+     * we receive from\n+     * {@link Client.Reads#searchReadGroupSets(SearchReadGroupSetsRequest)}.\n+     *\n+     * @throws AvroRemoteException if there's a communication problem or server exception ({@link GAException})\n+     */\n+    @Test\n+    public void checkPagingOneByOneThroughReadGroupSets() throws AvroRemoteException {\n+\n+        // retrieve them all - this may return fewer than \"all.\"\n+        final List<ReadGroupSet> listOfReadGroupSets = Utils.getAllReadGroupSets(client);\n+        assertThat(listOfReadGroupSets).isNotEmpty();\n+\n+        // we will do a set comparison after retrieving them 1 at a time\n+        final Set<ReadGroupSet> setOfExpectedReadGroupSets = new HashSet<>(listOfReadGroupSets);\n+        assertThat(listOfReadGroupSets).hasSize(setOfExpectedReadGroupSets.size());\n+\n+        final Set<ReadGroupSet> setOfReadGroupSetsGathered1By1 =\n+                new HashSet<>(setOfExpectedReadGroupSets.size());\n+        // page through the ReadGroupSets using the same query parameters\n+        String pageToken = null;\n+        do {\n+            final SearchReadGroupSetsRequest pageReq =\n+                    SearchReadGroupSetsRequest.newBuilder()\n+                                              .setDatasetId(TestData.getDatasetId())\n+                                              .setPageSize(1)\n+                                              .setPageToken(pageToken)\n+                                              .build();\n+            final SearchReadGroupSetsResponse pageResp = client.reads.searchReadGroupSets(pageReq);\n+            final List<ReadGroupSet> pageOfReadGroupSets = pageResp.getReadGroupSets();\n+            pageToken = pageResp.getNextPageToken();\n+\n+            assertThat(pageOfReadGroupSets).hasSize(1);\n+            setOfReadGroupSetsGathered1By1.add(pageOfReadGroupSets.get(0));\n+        } while (pageToken != null);\n+\n+        assertThat(setOfReadGroupSetsGathered1By1).containsAll(setOfExpectedReadGroupSets);","path":"cts-java/src/test/java/org/ga4gh/cts/api/reads/ReadGroupSetsPagingIT.java","position":69,"original_position":69,"commit_id":"5a1039ac5d1139722a8a4529c78dd7afb7c56e86","original_commit_id":"5a1039ac5d1139722a8a4529c78dd7afb7c56e86","user":{"login":"calbach","id":822298,"avatar_url":"https://avatars.githubusercontent.com/u/822298?v=3","gravatar_id":"","url":"https://api.github.com/users/calbach","html_url":"https://github.com/calbach","followers_url":"https://api.github.com/users/calbach/followers","following_url":"https://api.github.com/users/calbach/following{/other_user}","gists_url":"https://api.github.com/users/calbach/gists{/gist_id}","starred_url":"https://api.github.com/users/calbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calbach/subscriptions","organizations_url":"https://api.github.com/users/calbach/orgs","repos_url":"https://api.github.com/users/calbach/repos","events_url":"https://api.github.com/users/calbach/events{/privacy}","received_events_url":"https://api.github.com/users/calbach/received_events","type":"User","site_admin":false},"body":"This is a weaker assertion than what you want, I think. For instance, gathered1By1 could be a superset.","created_at":"2015-10-05T15:36:28Z","updated_at":"2015-10-05T15:36:28Z","html_url":"https://github.com/ga4gh/compliance/pull/102#discussion_r41158625","pull_request_url":"https://api.github.com/repos/ga4gh/compliance/pulls/102","_links":{"self":{"href":"https://api.github.com/repos/ga4gh/compliance/pulls/comments/41158625"},"html":{"href":"https://github.com/ga4gh/compliance/pull/102#discussion_r41158625"},"pull_request":{"href":"https://api.github.com/repos/ga4gh/compliance/pulls/102"}}},"pull_request":{"url":"https://api.github.com/repos/ga4gh/compliance/pulls/102","id":46309231,"html_url":"https://github.com/ga4gh/compliance/pull/102","diff_url":"https://github.com/ga4gh/compliance/pull/102.diff","patch_url":"https://github.com/ga4gh/compliance/pull/102.patch","issue_url":"https://api.github.com/repos/ga4gh/compliance/issues/102","number":102,"state":"open","locked":false,"title":"Adding back reads tests.","user":{"login":"macieksmuga","id":6685511,"avatar_url":"https://avatars.githubusercontent.com/u/6685511?v=3","gravatar_id":"","url":"https://api.github.com/users/macieksmuga","html_url":"https://github.com/macieksmuga","followers_url":"https://api.github.com/users/macieksmuga/followers","following_url":"https://api.github.com/users/macieksmuga/following{/other_user}","gists_url":"https://api.github.com/users/macieksmuga/gists{/gist_id}","starred_url":"https://api.github.com/users/macieksmuga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macieksmuga/subscriptions","organizations_url":"https://api.github.com/users/macieksmuga/orgs","repos_url":"https://api.github.com/users/macieksmuga/repos","events_url":"https://api.github.com/users/macieksmuga/events{/privacy}","received_events_url":"https://api.github.com/users/macieksmuga/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-29T17:49:22Z","updated_at":"2015-10-05T15:36:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a440cdab6c0f7f45ecc602843aea1a9d63f22067","assignee":null,"milestone":{"url":"https://api.github.com/repos/ga4gh/compliance/milestones/1","html_url":"https://github.com/ga4gh/compliance/milestones/baseline","labels_url":"https://api.github.com/repos/ga4gh/compliance/milestones/1/labels","id":1277888,"number":1,"title":"baseline","description":"bring schemas, server and compliance into lockstep","creator":{"login":"macieksmuga","id":6685511,"avatar_url":"https://avatars.githubusercontent.com/u/6685511?v=3","gravatar_id":"","url":"https://api.github.com/users/macieksmuga","html_url":"https://github.com/macieksmuga","followers_url":"https://api.github.com/users/macieksmuga/followers","following_url":"https://api.github.com/users/macieksmuga/following{/other_user}","gists_url":"https://api.github.com/users/macieksmuga/gists{/gist_id}","starred_url":"https://api.github.com/users/macieksmuga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macieksmuga/subscriptions","organizations_url":"https://api.github.com/users/macieksmuga/orgs","repos_url":"https://api.github.com/users/macieksmuga/repos","events_url":"https://api.github.com/users/macieksmuga/events{/privacy}","received_events_url":"https://api.github.com/users/macieksmuga/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":6,"state":"open","created_at":"2015-08-28T16:21:55Z","updated_at":"2015-09-29T18:01:58Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/ga4gh/compliance/pulls/102/commits","review_comments_url":"https://api.github.com/repos/ga4gh/compliance/pulls/102/comments","review_comment_url":"https://api.github.com/repos/ga4gh/compliance/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ga4gh/compliance/issues/102/comments","statuses_url":"https://api.github.com/repos/ga4gh/compliance/statuses/5a1039ac5d1139722a8a4529c78dd7afb7c56e86","head":{"label":"ga4gh:reads_tests","ref":"reads_tests","sha":"5a1039ac5d1139722a8a4529c78dd7afb7c56e86","user":{"login":"ga4gh","id":6921777,"avatar_url":"https://avatars.githubusercontent.com/u/6921777?v=3","gravatar_id":"","url":"https://api.github.com/users/ga4gh","html_url":"https://github.com/ga4gh","followers_url":"https://api.github.com/users/ga4gh/followers","following_url":"https://api.github.com/users/ga4gh/following{/other_user}","gists_url":"https://api.github.com/users/ga4gh/gists{/gist_id}","starred_url":"https://api.github.com/users/ga4gh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga4gh/subscriptions","organizations_url":"https://api.github.com/users/ga4gh/orgs","repos_url":"https://api.github.com/users/ga4gh/repos","events_url":"https://api.github.com/users/ga4gh/events{/privacy}","received_events_url":"https://api.github.com/users/ga4gh/received_events","type":"Organization","site_admin":false},"repo":{"id":23127683,"name":"compliance","full_name":"ga4gh/compliance","owner":{"login":"ga4gh","id":6921777,"avatar_url":"https://avatars.githubusercontent.com/u/6921777?v=3","gravatar_id":"","url":"https://api.github.com/users/ga4gh","html_url":"https://github.com/ga4gh","followers_url":"https://api.github.com/users/ga4gh/followers","following_url":"https://api.github.com/users/ga4gh/following{/other_user}","gists_url":"https://api.github.com/users/ga4gh/gists{/gist_id}","starred_url":"https://api.github.com/users/ga4gh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga4gh/subscriptions","organizations_url":"https://api.github.com/users/ga4gh/orgs","repos_url":"https://api.github.com/users/ga4gh/repos","events_url":"https://api.github.com/users/ga4gh/events{/privacy}","received_events_url":"https://api.github.com/users/ga4gh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ga4gh/compliance","description":"A compliance test suite for the APIs defined in the schemas repository.","fork":false,"url":"https://api.github.com/repos/ga4gh/compliance","forks_url":"https://api.github.com/repos/ga4gh/compliance/forks","keys_url":"https://api.github.com/repos/ga4gh/compliance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ga4gh/compliance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ga4gh/compliance/teams","hooks_url":"https://api.github.com/repos/ga4gh/compliance/hooks","issue_events_url":"https://api.github.com/repos/ga4gh/compliance/issues/events{/number}","events_url":"https://api.github.com/repos/ga4gh/compliance/events","assignees_url":"https://api.github.com/repos/ga4gh/compliance/assignees{/user}","branches_url":"https://api.github.com/repos/ga4gh/compliance/branches{/branch}","tags_url":"https://api.github.com/repos/ga4gh/compliance/tags","blobs_url":"https://api.github.com/repos/ga4gh/compliance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ga4gh/compliance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ga4gh/compliance/git/refs{/sha}","trees_url":"https://api.github.com/repos/ga4gh/compliance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ga4gh/compliance/statuses/{sha}","languages_url":"https://api.github.com/repos/ga4gh/compliance/languages","stargazers_url":"https://api.github.com/repos/ga4gh/compliance/stargazers","contributors_url":"https://api.github.com/repos/ga4gh/compliance/contributors","subscribers_url":"https://api.github.com/repos/ga4gh/compliance/subscribers","subscription_url":"https://api.github.com/repos/ga4gh/compliance/subscription","commits_url":"https://api.github.com/repos/ga4gh/compliance/commits{/sha}","git_commits_url":"https://api.github.com/repos/ga4gh/compliance/git/commits{/sha}","comments_url":"https://api.github.com/repos/ga4gh/compliance/comments{/number}","issue_comment_url":"https://api.github.com/repos/ga4gh/compliance/issues/comments{/number}","contents_url":"https://api.github.com/repos/ga4gh/compliance/contents/{+path}","compare_url":"https://api.github.com/repos/ga4gh/compliance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ga4gh/compliance/merges","archive_url":"https://api.github.com/repos/ga4gh/compliance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ga4gh/compliance/downloads","issues_url":"https://api.github.com/repos/ga4gh/compliance/issues{/number}","pulls_url":"https://api.github.com/repos/ga4gh/compliance/pulls{/number}","milestones_url":"https://api.github.com/repos/ga4gh/compliance/milestones{/number}","notifications_url":"https://api.github.com/repos/ga4gh/compliance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ga4gh/compliance/labels{/name}","releases_url":"https://api.github.com/repos/ga4gh/compliance/releases{/id}","created_at":"2014-08-19T22:22:15Z","updated_at":"2015-09-29T16:41:54Z","pushed_at":"2015-10-02T17:18:52Z","git_url":"git://github.com/ga4gh/compliance.git","ssh_url":"git@github.com:ga4gh/compliance.git","clone_url":"https://github.com/ga4gh/compliance.git","svn_url":"https://github.com/ga4gh/compliance","homepage":null,"size":3062,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":21,"forks":13,"open_issues":21,"watchers":5,"default_branch":"master"}},"base":{"label":"ga4gh:master","ref":"master","sha":"97a0bfb765e4301b1a3125b9c90987d2fbe26307","user":{"login":"ga4gh","id":6921777,"avatar_url":"https://avatars.githubusercontent.com/u/6921777?v=3","gravatar_id":"","url":"https://api.github.com/users/ga4gh","html_url":"https://github.com/ga4gh","followers_url":"https://api.github.com/users/ga4gh/followers","following_url":"https://api.github.com/users/ga4gh/following{/other_user}","gists_url":"https://api.github.com/users/ga4gh/gists{/gist_id}","starred_url":"https://api.github.com/users/ga4gh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga4gh/subscriptions","organizations_url":"https://api.github.com/users/ga4gh/orgs","repos_url":"https://api.github.com/users/ga4gh/repos","events_url":"https://api.github.com/users/ga4gh/events{/privacy}","received_events_url":"https://api.github.com/users/ga4gh/received_events","type":"Organization","site_admin":false},"repo":{"id":23127683,"name":"compliance","full_name":"ga4gh/compliance","owner":{"login":"ga4gh","id":6921777,"avatar_url":"https://avatars.githubusercontent.com/u/6921777?v=3","gravatar_id":"","url":"https://api.github.com/users/ga4gh","html_url":"https://github.com/ga4gh","followers_url":"https://api.github.com/users/ga4gh/followers","following_url":"https://api.github.com/users/ga4gh/following{/other_user}","gists_url":"https://api.github.com/users/ga4gh/gists{/gist_id}","starred_url":"https://api.github.com/users/ga4gh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga4gh/subscriptions","organizations_url":"https://api.github.com/users/ga4gh/orgs","repos_url":"https://api.github.com/users/ga4gh/repos","events_url":"https://api.github.com/users/ga4gh/events{/privacy}","received_events_url":"https://api.github.com/users/ga4gh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ga4gh/compliance","description":"A compliance test suite for the APIs defined in the schemas repository.","fork":false,"url":"https://api.github.com/repos/ga4gh/compliance","forks_url":"https://api.github.com/repos/ga4gh/compliance/forks","keys_url":"https://api.github.com/repos/ga4gh/compliance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ga4gh/compliance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ga4gh/compliance/teams","hooks_url":"https://api.github.com/repos/ga4gh/compliance/hooks","issue_events_url":"https://api.github.com/repos/ga4gh/compliance/issues/events{/number}","events_url":"https://api.github.com/repos/ga4gh/compliance/events","assignees_url":"https://api.github.com/repos/ga4gh/compliance/assignees{/user}","branches_url":"https://api.github.com/repos/ga4gh/compliance/branches{/branch}","tags_url":"https://api.github.com/repos/ga4gh/compliance/tags","blobs_url":"https://api.github.com/repos/ga4gh/compliance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ga4gh/compliance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ga4gh/compliance/git/refs{/sha}","trees_url":"https://api.github.com/repos/ga4gh/compliance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ga4gh/compliance/statuses/{sha}","languages_url":"https://api.github.com/repos/ga4gh/compliance/languages","stargazers_url":"https://api.github.com/repos/ga4gh/compliance/stargazers","contributors_url":"https://api.github.com/repos/ga4gh/compliance/contributors","subscribers_url":"https://api.github.com/repos/ga4gh/compliance/subscribers","subscription_url":"https://api.github.com/repos/ga4gh/compliance/subscription","commits_url":"https://api.github.com/repos/ga4gh/compliance/commits{/sha}","git_commits_url":"https://api.github.com/repos/ga4gh/compliance/git/commits{/sha}","comments_url":"https://api.github.com/repos/ga4gh/compliance/comments{/number}","issue_comment_url":"https://api.github.com/repos/ga4gh/compliance/issues/comments{/number}","contents_url":"https://api.github.com/repos/ga4gh/compliance/contents/{+path}","compare_url":"https://api.github.com/repos/ga4gh/compliance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ga4gh/compliance/merges","archive_url":"https://api.github.com/repos/ga4gh/compliance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ga4gh/compliance/downloads","issues_url":"https://api.github.com/repos/ga4gh/compliance/issues{/number}","pulls_url":"https://api.github.com/repos/ga4gh/compliance/pulls{/number}","milestones_url":"https://api.github.com/repos/ga4gh/compliance/milestones{/number}","notifications_url":"https://api.github.com/repos/ga4gh/compliance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ga4gh/compliance/labels{/name}","releases_url":"https://api.github.com/repos/ga4gh/compliance/releases{/id}","created_at":"2014-08-19T22:22:15Z","updated_at":"2015-09-29T16:41:54Z","pushed_at":"2015-10-02T17:18:52Z","git_url":"git://github.com/ga4gh/compliance.git","ssh_url":"git@github.com:ga4gh/compliance.git","clone_url":"https://github.com/ga4gh/compliance.git","svn_url":"https://github.com/ga4gh/compliance","homepage":null,"size":3062,"stargazers_count":5,"watchers_count":5,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":21,"forks":13,"open_issues":21,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ga4gh/compliance/pulls/102"},"html":{"href":"https://github.com/ga4gh/compliance/pull/102"},"issue":{"href":"https://api.github.com/repos/ga4gh/compliance/issues/102"},"comments":{"href":"https://api.github.com/repos/ga4gh/compliance/issues/102/comments"},"review_comments":{"href":"https://api.github.com/repos/ga4gh/compliance/pulls/102/comments"},"review_comment":{"href":"https://api.github.com/repos/ga4gh/compliance/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ga4gh/compliance/pulls/102/commits"},"statuses":{"href":"https://api.github.com/repos/ga4gh/compliance/statuses/5a1039ac5d1139722a8a4529c78dd7afb7c56e86"}}}}