{"action":"created","comment":{"url":"https://api.github.com/repos/ga4gh/compliance/pulls/comments/39061139","id":39061139,"diff_hunk":"@@ -21,49 +21,132 @@\n /**\n  * Reference sets-related compliance tests.\n  *\n- * @author Herb Jellinek\n+ * @author Maciek Smuga-Otto\n  */\n-@Category(ReadsTests.class)\n+@Category(ReferencesTests.class)\n @RunWith(JUnitParamsRunner.class)\n public class ReferenceSetsSearchIT {\n \n     private static Client client = new Client(URLMAPPING.getInstance());\n \n     /**\n-     * Reference sets. Searches for reference set GRCh37 by accession (GCA_000001405.15) and then fetches that same\n-     * reference set by ID.\n-     * <ul>\n-     * <li>Query 1: <pre>/referencesets/search accessions: [\"GCA_000001405.15\"] pageSize: 1</pre></li>\n-     * <li>Test 1: assert that we received a {@link SearchReferenceSetsResponse} object containing an array of\n-     * {@link ReferenceSet} objects.  For each one, assert that <pre>ncbiTaxonId == 9606 AND\n-     * assemblyId == GRCh38</pre>.  And do this for each ID in referenceIds:</li>\n-     * <li>Query 2: <pre>/referencesets/(ref set ID)</pre></li>\n-     * <li>Test 2: assert that the ID of the returned object == ref set ID above.</li>\n-     * </ul>\n+     * Fetch reference sets and make sure we get some.\n+     *\n      * @throws AvroRemoteException if there's a communication problem or server exception ({@link GAException})\n      */\n     @Test\n-    public void searchForExpectedReferenceSets() throws AvroRemoteException {\n-        final String accessionNumber = \"GCA_000001405.15\";\n-        final int ncbiTaxonId = 9606;\n-        final String assemblyId = \"GRCh38\";\n-\n-        final SearchReferenceSetsRequest req =\n-                SearchReferenceSetsRequest.newBuilder()\n-                                            .setAccessions(aSingle(accessionNumber))\n-                                            .build();\n+    public void checkSearchingReferenceSetsReturnsSome() throws AvroRemoteException {\n+        final SearchReferenceSetsRequest req = \n+            SearchReferenceSetsRequest.newBuilder().build();\n         final SearchReferenceSetsResponse resp = client.references.searchReferenceSets(req);\n+\n+        final List<ReferenceSet> sets = resp.getReferenceSets();\n+        assertThat(sets).isNotEmpty();\n+        sets.stream().forEach(rs -> assertThat(rs.getId()).isNotNull());\n+    }\n+\n+\n+    /**\n+     * Fetch reference sets and make sure they're well-formed.\n+     *\n+     * @throws AvroRemoteException if there's a communication problem or server exception ({@link GAException})\n+     */\n+    @Test\n+    public void checkSearchingReferenceSetsReturnsWellFormed() throws AvroRemoteException {\n+        final SearchReferenceSetsRequest req = \n+            SearchReferenceSetsRequest.newBuilder().build();\n+        final SearchReferenceSetsResponse resp = client.references.searchReferenceSets(req);\n+\n+        final List<ReferenceSet> sets = resp.getReferenceSets();\n+\n+        sets.stream().forEach(rs -> assertThat(rs.getId()).isNotNull());\n+        sets.stream().forEach(rs -> assertThat(rs.getMd5checksum()).isNotNull());\n+        sets.stream().forEach(rs -> assertThat(rs.getSourceAccessions()).isNotNull());\n+    }\n+\n+    /**\n+     * Search for reference set by accession number.\n+     *\n+     * @throws AvroRemoteException if there's a communication problem or server exception ({@link GAException})\n+     */\n+    @Test\n+    public void searchForReferenceSetByAccessionNumber() throws AvroRemoteException {\n+        final String accession = \"GA4GH_CTS_01\";\n+        final String assemblyId = \"hg37\";\n+\n+        final SearchReferenceSetsRequest req = \n+            SearchReferenceSetsRequest.newBuilder()\n+                                        .setAccessions(aSingle(accession))\n+                                        .build();\n+        final SearchReferenceSetsResponse resp = client.references.searchReferenceSets(req);\n+        \n         final List<ReferenceSet> refSets = resp.getReferenceSets();\n+        assertThat(refSets).isNotEmpty();\n+        refSets.stream().forEach(rs -> assertThat(rs.getAssemblyId()).isEqualTo(assemblyId));\n+    }\n \n-        refSets.stream().forEach(rs -> assertThat(rs.getNcbiTaxonId()).isEqualTo(ncbiTaxonId));\n+    /**\n+     * Search for reference set by md5 checksum.\n+     *\n+     * @throws AvroRemoteException if there's a communication problem or server exception ({@link GAException})\n+     */\n+    @Test\n+    public void searchForReferenceSetByMD5Checksum() throws AvroRemoteException {\n+        final String md5checksum = \"90977a37195d3fd247e4916b5b4cbae8\";\n+        final String assemblyId = \"hg37\";\n+\n+        final SearchReferenceSetsRequest req = \n+            SearchReferenceSetsRequest.newBuilder()\n+                                        .setMd5checksums(aSingle(md5checksum))\n+                                        .build();\n+        final SearchReferenceSetsResponse resp = client.references.searchReferenceSets(req);\n+        \n+        final List<ReferenceSet> refSets = resp.getReferenceSets();\n+        assertThat(refSets).isNotEmpty();\n         refSets.stream().forEach(rs -> assertThat(rs.getAssemblyId()).isEqualTo(assemblyId));\n+        refSets.stream().forEach(rs -> assertThat(rs.getMd5checksum()).isEqualTo(md5checksum));\n+}\n \n-        // do query 2 and test 2\n-        for (ReferenceSet refSet : refSets) {\n-            final String id = refSet.getId();\n-            final ReferenceSet fetchedRefSet = client.references.getReferenceSet(id);\n-            assertThat(fetchedRefSet.getId()).isEqualTo(id);\n-        }\n+    /**\n+     * Search for reference set by assemblyId.\n+     *\n+     * @throws AvroRemoteException if there's a communication problem or server exception ({@link GAException})\n+     */\n+    @Test\n+    public void searchForReferenceSetByAssemblyId() throws AvroRemoteException {\n+        final String assemblyId = \"hg37\";\n+        final String md5checksum = \"90977a37195d3fd247e4916b5b4cbae8\";\n+\n+        final SearchReferenceSetsRequest req = \n+            SearchReferenceSetsRequest.newBuilder()\n+                                        .setAssemblyId(assemblyId)\n+                                        .build();\n+        final SearchReferenceSetsResponse resp = client.references.searchReferenceSets(req);\n+        \n+        final List<ReferenceSet> refSets = resp.getReferenceSets();\n+        assertThat(refSets).isNotEmpty();\n+        refSets.stream().forEach(rs -> assertThat(rs.getAssemblyId()).isEqualTo(assemblyId));\n+        refSets.stream().forEach(rs -> assertThat(rs.getMd5checksum()).isEqualTo(md5checksum));\n     }\n \n+    /**\n+     * Verify that we're looking up the right species (NCBI Taxonomy ID).\n+     *\n+     * @throws AvroRemoteException if there's a communication problem or server exception ({@link GAException})\n+     */\n+    @Test\n+    public void checkReferenceSetHasCorrectTaxonId() throws AvroRemoteException {\n+        final String accession = \"GA4GH_CTS_01\";","path":"cts-java/src/test/java/org/ga4gh/cts/api/references/ReferenceSetsSearchIT.java","position":147,"original_position":147,"commit_id":"d5c7d4be014eae4c7e9cb1a721f69e959bdab06f","original_commit_id":"d5c7d4be014eae4c7e9cb1a721f69e959bdab06f","user":{"login":"hjellinek","id":4968570,"avatar_url":"https://avatars.githubusercontent.com/u/4968570?v=3","gravatar_id":"","url":"https://api.github.com/users/hjellinek","html_url":"https://github.com/hjellinek","followers_url":"https://api.github.com/users/hjellinek/followers","following_url":"https://api.github.com/users/hjellinek/following{/other_user}","gists_url":"https://api.github.com/users/hjellinek/gists{/gist_id}","starred_url":"https://api.github.com/users/hjellinek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hjellinek/subscriptions","organizations_url":"https://api.github.com/users/hjellinek/orgs","repos_url":"https://api.github.com/users/hjellinek/repos","events_url":"https://api.github.com/users/hjellinek/events{/privacy}","received_events_url":"https://api.github.com/users/hjellinek/received_events","type":"User","site_admin":false},"body":"For consistency, `accessionId` would be a better name.","created_at":"2015-09-09T15:56:48Z","updated_at":"2015-09-09T15:56:48Z","html_url":"https://github.com/ga4gh/compliance/pull/73#discussion_r39061139","pull_request_url":"https://api.github.com/repos/ga4gh/compliance/pulls/73","_links":{"self":{"href":"https://api.github.com/repos/ga4gh/compliance/pulls/comments/39061139"},"html":{"href":"https://github.com/ga4gh/compliance/pull/73#discussion_r39061139"},"pull_request":{"href":"https://api.github.com/repos/ga4gh/compliance/pulls/73"}}},"pull_request":{"url":"https://api.github.com/repos/ga4gh/compliance/pulls/73","id":44522955,"html_url":"https://github.com/ga4gh/compliance/pull/73","diff_url":"https://github.com/ga4gh/compliance/pull/73.diff","patch_url":"https://github.com/ga4gh/compliance/pull/73.patch","issue_url":"https://api.github.com/repos/ga4gh/compliance/issues/73","number":73,"state":"open","locked":false,"title":"Added references 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":"The references tests are updated to reflect the new data in the compliance dataset.\r\nAlso, greater coverage of endpoints, other miscellaneous fixes.\r\n\r\nResolves Issues #69, #54.","created_at":"2015-09-09T08:33:58Z","updated_at":"2015-09-09T15:56:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a365968c9252600e32a58dc8ed77a5629c2d82a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ga4gh/compliance/pulls/73/commits","review_comments_url":"https://api.github.com/repos/ga4gh/compliance/pulls/73/comments","review_comment_url":"https://api.github.com/repos/ga4gh/compliance/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ga4gh/compliance/issues/73/comments","statuses_url":"https://api.github.com/repos/ga4gh/compliance/statuses/d5c7d4be014eae4c7e9cb1a721f69e959bdab06f","head":{"label":"macieksmuga:referencesTests","ref":"referencesTests","sha":"d5c7d4be014eae4c7e9cb1a721f69e959bdab06f","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},"repo":{"id":39800494,"name":"compliance","full_name":"macieksmuga/compliance","owner":{"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},"private":false,"html_url":"https://github.com/macieksmuga/compliance","description":"A compliance test suite for the APIs defined in the schemas repository.","fork":true,"url":"https://api.github.com/repos/macieksmuga/compliance","forks_url":"https://api.github.com/repos/macieksmuga/compliance/forks","keys_url":"https://api.github.com/repos/macieksmuga/compliance/keys{/key_id}","collaborators_url":"https://api.github.com/repos/macieksmuga/compliance/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/macieksmuga/compliance/teams","hooks_url":"https://api.github.com/repos/macieksmuga/compliance/hooks","issue_events_url":"https://api.github.com/repos/macieksmuga/compliance/issues/events{/number}","events_url":"https://api.github.com/repos/macieksmuga/compliance/events","assignees_url":"https://api.github.com/repos/macieksmuga/compliance/assignees{/user}","branches_url":"https://api.github.com/repos/macieksmuga/compliance/branches{/branch}","tags_url":"https://api.github.com/repos/macieksmuga/compliance/tags","blobs_url":"https://api.github.com/repos/macieksmuga/compliance/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/macieksmuga/compliance/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/macieksmuga/compliance/git/refs{/sha}","trees_url":"https://api.github.com/repos/macieksmuga/compliance/git/trees{/sha}","statuses_url":"https://api.github.com/repos/macieksmuga/compliance/statuses/{sha}","languages_url":"https://api.github.com/repos/macieksmuga/compliance/languages","stargazers_url":"https://api.github.com/repos/macieksmuga/compliance/stargazers","contributors_url":"https://api.github.com/repos/macieksmuga/compliance/contributors","subscribers_url":"https://api.github.com/repos/macieksmuga/compliance/subscribers","subscription_url":"https://api.github.com/repos/macieksmuga/compliance/subscription","commits_url":"https://api.github.com/repos/macieksmuga/compliance/commits{/sha}","git_commits_url":"https://api.github.com/repos/macieksmuga/compliance/git/commits{/sha}","comments_url":"https://api.github.com/repos/macieksmuga/compliance/comments{/number}","issue_comment_url":"https://api.github.com/repos/macieksmuga/compliance/issues/comments{/number}","contents_url":"https://api.github.com/repos/macieksmuga/compliance/contents/{+path}","compare_url":"https://api.github.com/repos/macieksmuga/compliance/compare/{base}...{head}","merges_url":"https://api.github.com/repos/macieksmuga/compliance/merges","archive_url":"https://api.github.com/repos/macieksmuga/compliance/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/macieksmuga/compliance/downloads","issues_url":"https://api.github.com/repos/macieksmuga/compliance/issues{/number}","pulls_url":"https://api.github.com/repos/macieksmuga/compliance/pulls{/number}","milestones_url":"https://api.github.com/repos/macieksmuga/compliance/milestones{/number}","notifications_url":"https://api.github.com/repos/macieksmuga/compliance/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/macieksmuga/compliance/labels{/name}","releases_url":"https://api.github.com/repos/macieksmuga/compliance/releases{/id}","created_at":"2015-07-27T22:14:19Z","updated_at":"2015-07-27T22:14:19Z","pushed_at":"2015-09-09T08:31:35Z","git_url":"git://github.com/macieksmuga/compliance.git","ssh_url":"git@github.com:macieksmuga/compliance.git","clone_url":"https://github.com/macieksmuga/compliance.git","svn_url":"https://github.com/macieksmuga/compliance","homepage":null,"size":1951,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ga4gh:compliance_redux","ref":"compliance_redux","sha":"e99f294227fa41c411237a67286f968b47e7f2f5","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-04-27T09:07:28Z","pushed_at":"2015-09-09T08:33:58Z","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":2289,"stargazers_count":5,"watchers_count":5,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":16,"forks":10,"open_issues":16,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ga4gh/compliance/pulls/73"},"html":{"href":"https://github.com/ga4gh/compliance/pull/73"},"issue":{"href":"https://api.github.com/repos/ga4gh/compliance/issues/73"},"comments":{"href":"https://api.github.com/repos/ga4gh/compliance/issues/73/comments"},"review_comments":{"href":"https://api.github.com/repos/ga4gh/compliance/pulls/73/comments"},"review_comment":{"href":"https://api.github.com/repos/ga4gh/compliance/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ga4gh/compliance/pulls/73/commits"},"statuses":{"href":"https://api.github.com/repos/ga4gh/compliance/statuses/d5c7d4be014eae4c7e9cb1a721f69e959bdab06f"}}}}