{"action":"created","comment":{"url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/comments/87807218","pull_request_review_id":8403254,"id":87807218,"diff_hunk":"@@ -0,0 +1,91 @@\n+/*\n+ * Copyright 2016 EMBL - European Bioinformatics Institute\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package uk.ac.ebi.eva.pipeline.io.writers;\n+\n+import com.mongodb.BasicDBObject;\n+import com.mongodb.DBCollection;\n+import org.junit.Before;\n+import org.junit.Test;\n+import org.mockito.Mockito;\n+import org.opencb.biodata.models.variant.Variant;\n+import org.opencb.datastore.core.ObjectMap;\n+import org.springframework.data.mongodb.core.MongoOperations;\n+import uk.ac.ebi.eva.pipeline.configuration.JobParametersNames;\n+import uk.ac.ebi.eva.pipeline.model.converters.data.VariantToMongoDbObjectConverter;\n+import uk.ac.ebi.eva.test.utils.JobTestUtils;\n+import uk.ac.ebi.eva.utils.MongoDBHelper;\n+import java.net.UnknownHostException;\n+import java.util.*;\n+import static org.junit.Assert.assertEquals;\n+import static org.mockito.Matchers.any;\n+import static org.mockito.Mockito.when;\n+\n+/**\n+ * Testing {@link VariantMongoWriter}\n+ */\n+public class VariantMongoWriterTest {\n+    private VariantMongoWriter variantMongoWriter;\n+    private VariantToMongoDbObjectConverter variantToMongoDbObjectConverter =\n+            Mockito.mock(VariantToMongoDbObjectConverter.class);\n+    private ObjectMap objectMap = new ObjectMap();\n+    private final String collectionName = \"variants\";\n+\n+    @Before\n+    public void setUp() throws Exception {\n+        objectMap.put(JobParametersNames.CONFIG_DB_READPREFERENCE, \"primary\");\n+    }\n+\n+    @Test\n+    public void noVariantsNothingShouldBeWritten() throws UnknownHostException {\n+        String dbName = \"VariantMongoWriterNoVariant\";\n+\n+        objectMap.put(\"db.name\", dbName);","path":"src/test/java/uk/ac/ebi/eva/pipeline/io/writers/VariantMongoWriterTest.java","position":55,"original_position":55,"commit_id":"184b6733940f689d0e00d2a59381784ccb55bcd0","original_commit_id":"184b6733940f689d0e00d2a59381784ccb55bcd0","user":{"login":"poggio84","id":525678,"avatar_url":"https://avatars.githubusercontent.com/u/525678?v=3","gravatar_id":"","url":"https://api.github.com/users/poggio84","html_url":"https://github.com/poggio84","followers_url":"https://api.github.com/users/poggio84/followers","following_url":"https://api.github.com/users/poggio84/following{/other_user}","gists_url":"https://api.github.com/users/poggio84/gists{/gist_id}","starred_url":"https://api.github.com/users/poggio84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poggio84/subscriptions","organizations_url":"https://api.github.com/users/poggio84/orgs","repos_url":"https://api.github.com/users/poggio84/repos","events_url":"https://api.github.com/users/poggio84/events{/privacy}","received_events_url":"https://api.github.com/users/poggio84/received_events","type":"User","site_admin":false},"body":"done","created_at":"2016-11-14T14:13:25Z","updated_at":"2016-11-14T14:13:25Z","html_url":"https://github.com/EBIvariation/eva-pipeline/pull/35#discussion_r87807218","pull_request_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/comments/87807218"},"html":{"href":"https://github.com/EBIvariation/eva-pipeline/pull/35#discussion_r87807218"},"pull_request":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/35","id":92552123,"html_url":"https://github.com/EBIvariation/eva-pipeline/pull/35","diff_url":"https://github.com/EBIvariation/eva-pipeline/pull/35.diff","patch_url":"https://github.com/EBIvariation/eva-pipeline/pull/35.patch","issue_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/35","number":35,"state":"open","locked":false,"title":"MongoDB Variant writer","user":{"login":"poggio84","id":525678,"avatar_url":"https://avatars.githubusercontent.com/u/525678?v=3","gravatar_id":"","url":"https://api.github.com/users/poggio84","html_url":"https://github.com/poggio84","followers_url":"https://api.github.com/users/poggio84/followers","following_url":"https://api.github.com/users/poggio84/following{/other_user}","gists_url":"https://api.github.com/users/poggio84/gists{/gist_id}","starred_url":"https://api.github.com/users/poggio84/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poggio84/subscriptions","organizations_url":"https://api.github.com/users/poggio84/orgs","repos_url":"https://api.github.com/users/poggio84/repos","events_url":"https://api.github.com/users/poggio84/events{/privacy}","received_events_url":"https://api.github.com/users/poggio84/received_events","type":"User","site_admin":false},"body":"EVA-514","created_at":"2016-11-07T09:54:20Z","updated_at":"2016-11-14T14:13:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4b874ed367199b89c63f676eaf7b44254744e93","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/35/commits","review_comments_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/35/comments","review_comment_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/35/comments","statuses_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/statuses/184b6733940f689d0e00d2a59381784ccb55bcd0","head":{"label":"EBIvariation:MongoDB_variant_writer-EVA-514","ref":"MongoDB_variant_writer-EVA-514","sha":"184b6733940f689d0e00d2a59381784ccb55bcd0","user":{"login":"EBIvariation","id":6419333,"avatar_url":"https://avatars.githubusercontent.com/u/6419333?v=3","gravatar_id":"","url":"https://api.github.com/users/EBIvariation","html_url":"https://github.com/EBIvariation","followers_url":"https://api.github.com/users/EBIvariation/followers","following_url":"https://api.github.com/users/EBIvariation/following{/other_user}","gists_url":"https://api.github.com/users/EBIvariation/gists{/gist_id}","starred_url":"https://api.github.com/users/EBIvariation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBIvariation/subscriptions","organizations_url":"https://api.github.com/users/EBIvariation/orgs","repos_url":"https://api.github.com/users/EBIvariation/repos","events_url":"https://api.github.com/users/EBIvariation/events{/privacy}","received_events_url":"https://api.github.com/users/EBIvariation/received_events","type":"Organization","site_admin":false},"repo":{"id":29298780,"name":"eva-pipeline","full_name":"EBIvariation/eva-pipeline","owner":{"login":"EBIvariation","id":6419333,"avatar_url":"https://avatars.githubusercontent.com/u/6419333?v=3","gravatar_id":"","url":"https://api.github.com/users/EBIvariation","html_url":"https://github.com/EBIvariation","followers_url":"https://api.github.com/users/EBIvariation/followers","following_url":"https://api.github.com/users/EBIvariation/following{/other_user}","gists_url":"https://api.github.com/users/EBIvariation/gists{/gist_id}","starred_url":"https://api.github.com/users/EBIvariation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBIvariation/subscriptions","organizations_url":"https://api.github.com/users/EBIvariation/orgs","repos_url":"https://api.github.com/users/EBIvariation/repos","events_url":"https://api.github.com/users/EBIvariation/events{/privacy}","received_events_url":"https://api.github.com/users/EBIvariation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EBIvariation/eva-pipeline","description":"Genomic variation pipeline for the European Variation Archive, implemented using Spring Batch","fork":false,"url":"https://api.github.com/repos/EBIvariation/eva-pipeline","forks_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/forks","keys_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/teams","hooks_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/hooks","issue_events_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/events{/number}","events_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/events","assignees_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/assignees{/user}","branches_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/branches{/branch}","tags_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/tags","blobs_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/refs{/sha}","trees_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/statuses/{sha}","languages_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/languages","stargazers_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/stargazers","contributors_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/contributors","subscribers_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/subscribers","subscription_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/subscription","commits_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/commits{/sha}","git_commits_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/commits{/sha}","comments_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/comments{/number}","issue_comment_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/comments{/number}","contents_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/contents/{+path}","compare_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/merges","archive_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/downloads","issues_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues{/number}","pulls_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls{/number}","milestones_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/milestones{/number}","notifications_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/labels{/name}","releases_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/releases{/id}","deployments_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/deployments","created_at":"2015-01-15T13:34:10Z","updated_at":"2016-10-24T09:10:20Z","pushed_at":"2016-11-14T13:26:12Z","git_url":"git://github.com/EBIvariation/eva-pipeline.git","ssh_url":"git@github.com:EBIvariation/eva-pipeline.git","clone_url":"https://github.com/EBIvariation/eva-pipeline.git","svn_url":"https://github.com/EBIvariation/eva-pipeline","homepage":"http://www.ebi.ac.uk/eva","size":1584,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":0,"default_branch":"develop"}},"base":{"label":"EBIvariation:develop","ref":"develop","sha":"737466128f2ffe57f0bb191fd0bf86ee3132f1e8","user":{"login":"EBIvariation","id":6419333,"avatar_url":"https://avatars.githubusercontent.com/u/6419333?v=3","gravatar_id":"","url":"https://api.github.com/users/EBIvariation","html_url":"https://github.com/EBIvariation","followers_url":"https://api.github.com/users/EBIvariation/followers","following_url":"https://api.github.com/users/EBIvariation/following{/other_user}","gists_url":"https://api.github.com/users/EBIvariation/gists{/gist_id}","starred_url":"https://api.github.com/users/EBIvariation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBIvariation/subscriptions","organizations_url":"https://api.github.com/users/EBIvariation/orgs","repos_url":"https://api.github.com/users/EBIvariation/repos","events_url":"https://api.github.com/users/EBIvariation/events{/privacy}","received_events_url":"https://api.github.com/users/EBIvariation/received_events","type":"Organization","site_admin":false},"repo":{"id":29298780,"name":"eva-pipeline","full_name":"EBIvariation/eva-pipeline","owner":{"login":"EBIvariation","id":6419333,"avatar_url":"https://avatars.githubusercontent.com/u/6419333?v=3","gravatar_id":"","url":"https://api.github.com/users/EBIvariation","html_url":"https://github.com/EBIvariation","followers_url":"https://api.github.com/users/EBIvariation/followers","following_url":"https://api.github.com/users/EBIvariation/following{/other_user}","gists_url":"https://api.github.com/users/EBIvariation/gists{/gist_id}","starred_url":"https://api.github.com/users/EBIvariation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBIvariation/subscriptions","organizations_url":"https://api.github.com/users/EBIvariation/orgs","repos_url":"https://api.github.com/users/EBIvariation/repos","events_url":"https://api.github.com/users/EBIvariation/events{/privacy}","received_events_url":"https://api.github.com/users/EBIvariation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EBIvariation/eva-pipeline","description":"Genomic variation pipeline for the European Variation Archive, implemented using Spring Batch","fork":false,"url":"https://api.github.com/repos/EBIvariation/eva-pipeline","forks_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/forks","keys_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/teams","hooks_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/hooks","issue_events_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/events{/number}","events_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/events","assignees_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/assignees{/user}","branches_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/branches{/branch}","tags_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/tags","blobs_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/refs{/sha}","trees_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/statuses/{sha}","languages_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/languages","stargazers_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/stargazers","contributors_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/contributors","subscribers_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/subscribers","subscription_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/subscription","commits_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/commits{/sha}","git_commits_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/git/commits{/sha}","comments_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/comments{/number}","issue_comment_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/comments{/number}","contents_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/contents/{+path}","compare_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/merges","archive_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/downloads","issues_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues{/number}","pulls_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls{/number}","milestones_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/milestones{/number}","notifications_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/labels{/name}","releases_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/releases{/id}","deployments_url":"https://api.github.com/repos/EBIvariation/eva-pipeline/deployments","created_at":"2015-01-15T13:34:10Z","updated_at":"2016-10-24T09:10:20Z","pushed_at":"2016-11-14T13:26:12Z","git_url":"git://github.com/EBIvariation/eva-pipeline.git","ssh_url":"git@github.com:EBIvariation/eva-pipeline.git","clone_url":"https://github.com/EBIvariation/eva-pipeline.git","svn_url":"https://github.com/EBIvariation/eva-pipeline","homepage":"http://www.ebi.ac.uk/eva","size":1584,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":3,"forks":4,"open_issues":3,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/35"},"html":{"href":"https://github.com/EBIvariation/eva-pipeline/pull/35"},"issue":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/35"},"comments":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/EBIvariation/eva-pipeline/statuses/184b6733940f689d0e00d2a59381784ccb55bcd0"}}}}
{"actor":{"display_login":"poggio84"}}