{"action":"created","comment":{"url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments/167481551","pull_request_review_id":95704817,"id":167481551,"diff_hunk":"@@ -0,0 +1,60 @@\n+/**\n+ * This Source Code Form is subject to the terms of the Mozilla Public License,\n+ * v. 2.0. If a copy of the MPL was not distributed with this file, You can\n+ * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under\n+ * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.\n+ *\n+ * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS\n+ * graphic logo is a trademark of OpenMRS Inc.\n+ */\n+package org.openmrs.api;\n+\n+import org.junit.Before;\n+import org.junit.Test;\n+import org.openmrs.api.db.AdministrationDAO;\n+import org.openmrs.api.impl.AdministrationServiceImpl;\n+\n+import static org.mockito.Mockito.mock;\n+import static org.mockito.Mockito.never;\n+import static org.mockito.Mockito.verify;\n+\n+/**\n+ * Unit tests for {@link AdministrationService}.\n+ */\n+public class AdministrationServiceUnitTest {\n+\t\n+\tprivate AdministrationDAO adminDAO;\n+\t\n+\tprivate AdministrationService adminService;\n+\t\n+\t@Before\n+\tpublic void setUp() {\n+\t\t\n+\t\tadminService = new AdministrationServiceImpl();\n+\t\tadminDAO = mock(AdministrationDAO.class);\n+\t\tadminService.setAdministrationDAO(adminDAO);\n+\t}\n+\t\n+\t@Test\n+\tpublic void executeSQL_shouldReturnNullGivenNull() {\n+\t\t\n+\t\tadminService.executeSQL(null, true);\n+\t\n+\t\tverify(adminDAO, never()).executeSQL(\"was never called\", true);","path":"api/src/test/java/org/openmrs/api/AdministrationServiceUnitTest.java","position":43,"original_position":43,"commit_id":"f0591c512ba3353f2f9d3d9e9a2b361e11209fea","original_commit_id":"f0591c512ba3353f2f9d3d9e9a2b361e11209fea","user":{"login":"teleivo","id":4661144,"avatar_url":"https://avatars0.githubusercontent.com/u/4661144?v=4","gravatar_id":"","url":"https://api.github.com/users/teleivo","html_url":"https://github.com/teleivo","followers_url":"https://api.github.com/users/teleivo/followers","following_url":"https://api.github.com/users/teleivo/following{/other_user}","gists_url":"https://api.github.com/users/teleivo/gists{/gist_id}","starred_url":"https://api.github.com/users/teleivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teleivo/subscriptions","organizations_url":"https://api.github.com/users/teleivo/orgs","repos_url":"https://api.github.com/users/teleivo/repos","events_url":"https://api.github.com/users/teleivo/events{/privacy}","received_events_url":"https://api.github.com/users/teleivo/received_events","type":"User","site_admin":false},"body":"we want to verify that `executeSQL` is never called at all. The parameter I told you to use was wrong\r\nPlease replace with\r\n\r\n`verify(adminDAO, never()).executeSQL(anyString(), anyBoolean());`\r\n\r\nthis way we ensure that the method is never called no matter the parameters.\r\n","created_at":"2018-02-12T07:40:26Z","updated_at":"2018-02-12T07:43:34Z","html_url":"https://github.com/openmrs/openmrs-core/pull/2560#discussion_r167481551","pull_request_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2560","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments/167481551"},"html":{"href":"https://github.com/openmrs/openmrs-core/pull/2560#discussion_r167481551"},"pull_request":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2560"}}},"pull_request":{"url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2560","id":164131013,"html_url":"https://github.com/openmrs/openmrs-core/pull/2560","diff_url":"https://github.com/openmrs/openmrs-core/pull/2560.diff","patch_url":"https://github.com/openmrs/openmrs-core/pull/2560.patch","issue_url":"https://api.github.com/repos/openmrs/openmrs-core/issues/2560","number":2560,"state":"open","locked":false,"title":"TRUNK-5065 Add tests to AdministrationServiceImpl","user":{"login":"dilekamadushan","id":17608777,"avatar_url":"https://avatars0.githubusercontent.com/u/17608777?v=4","gravatar_id":"","url":"https://api.github.com/users/dilekamadushan","html_url":"https://github.com/dilekamadushan","followers_url":"https://api.github.com/users/dilekamadushan/followers","following_url":"https://api.github.com/users/dilekamadushan/following{/other_user}","gists_url":"https://api.github.com/users/dilekamadushan/gists{/gist_id}","starred_url":"https://api.github.com/users/dilekamadushan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilekamadushan/subscriptions","organizations_url":"https://api.github.com/users/dilekamadushan/orgs","repos_url":"https://api.github.com/users/dilekamadushan/repos","events_url":"https://api.github.com/users/dilekamadushan/events{/privacy}","received_events_url":"https://api.github.com/users/dilekamadushan/received_events","type":"User","site_admin":false},"body":"https://issues.openmrs.org/browse/TRUNK-5065\r\n\r\n## Description of what I changed\r\n\r\nAdded test cases for branches in AdministrationServiceImpl\r\n\r\n## Checklist: I completed these to help reviewers :)\r\n\r\n- [x] My pull request only contains **ONE single commit**\r\n(the number above, next to the 'Commits' tab is 1).\r\n\r\n- [x] My IDE is configured to follow the [**code style**](https://wiki.openmrs.org/display/docs/Java+Conventions) of this project.\r\n\r\n- [x] I have **added tests** to cover my changes. (If you refactored\r\n  existing code that was well tested you do not have to add tests)\r\n\r\n- [x] I ran `mvn clean package` right before creating this pull request and\r\n  added all formatting changes to my commit.\r\n\r\n- [x] All new and existing **tests passed**.\r\n\r\n- [x] My pull request is **based on the latest changes** of the master branch.\r\n","created_at":"2018-01-20T15:01:08Z","updated_at":"2018-02-12T07:43:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3a5b103bd9487668b60d3f9d48163f5298e399e5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2560/commits","review_comments_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2560/comments","review_comment_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openmrs/openmrs-core/issues/2560/comments","statuses_url":"https://api.github.com/repos/openmrs/openmrs-core/statuses/f0591c512ba3353f2f9d3d9e9a2b361e11209fea","head":{"label":"dilekamadushan:TRUNK-5065","ref":"TRUNK-5065","sha":"f0591c512ba3353f2f9d3d9e9a2b361e11209fea","user":{"login":"dilekamadushan","id":17608777,"avatar_url":"https://avatars0.githubusercontent.com/u/17608777?v=4","gravatar_id":"","url":"https://api.github.com/users/dilekamadushan","html_url":"https://github.com/dilekamadushan","followers_url":"https://api.github.com/users/dilekamadushan/followers","following_url":"https://api.github.com/users/dilekamadushan/following{/other_user}","gists_url":"https://api.github.com/users/dilekamadushan/gists{/gist_id}","starred_url":"https://api.github.com/users/dilekamadushan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilekamadushan/subscriptions","organizations_url":"https://api.github.com/users/dilekamadushan/orgs","repos_url":"https://api.github.com/users/dilekamadushan/repos","events_url":"https://api.github.com/users/dilekamadushan/events{/privacy}","received_events_url":"https://api.github.com/users/dilekamadushan/received_events","type":"User","site_admin":false},"repo":{"id":111167425,"name":"openmrs-core","full_name":"dilekamadushan/openmrs-core","owner":{"login":"dilekamadushan","id":17608777,"avatar_url":"https://avatars0.githubusercontent.com/u/17608777?v=4","gravatar_id":"","url":"https://api.github.com/users/dilekamadushan","html_url":"https://github.com/dilekamadushan","followers_url":"https://api.github.com/users/dilekamadushan/followers","following_url":"https://api.github.com/users/dilekamadushan/following{/other_user}","gists_url":"https://api.github.com/users/dilekamadushan/gists{/gist_id}","starred_url":"https://api.github.com/users/dilekamadushan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilekamadushan/subscriptions","organizations_url":"https://api.github.com/users/dilekamadushan/orgs","repos_url":"https://api.github.com/users/dilekamadushan/repos","events_url":"https://api.github.com/users/dilekamadushan/events{/privacy}","received_events_url":"https://api.github.com/users/dilekamadushan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dilekamadushan/openmrs-core","description":"OpenMRS API and web application code","fork":true,"url":"https://api.github.com/repos/dilekamadushan/openmrs-core","forks_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/forks","keys_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/teams","hooks_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/hooks","issue_events_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/issues/events{/number}","events_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/events","assignees_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/assignees{/user}","branches_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/branches{/branch}","tags_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/tags","blobs_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/statuses/{sha}","languages_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/languages","stargazers_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/stargazers","contributors_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/contributors","subscribers_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/subscribers","subscription_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/subscription","commits_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/contents/{+path}","compare_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/merges","archive_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/downloads","issues_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/issues{/number}","pulls_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/pulls{/number}","milestones_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/milestones{/number}","notifications_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/labels{/name}","releases_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/releases{/id}","deployments_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/deployments","created_at":"2017-11-18T01:45:20Z","updated_at":"2017-11-18T01:45:29Z","pushed_at":"2018-02-11T18:50:45Z","git_url":"git://github.com/dilekamadushan/openmrs-core.git","ssh_url":"git@github.com:dilekamadushan/openmrs-core.git","clone_url":"https://github.com/dilekamadushan/openmrs-core.git","svn_url":"https://github.com/dilekamadushan/openmrs-core","homepage":"http://openmrs.org","size":227156,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openmrs:master","ref":"master","sha":"e6b7f32033b9069941e0abba8391528bca0503a7","user":{"login":"openmrs","id":860776,"avatar_url":"https://avatars3.githubusercontent.com/u/860776?v=4","gravatar_id":"","url":"https://api.github.com/users/openmrs","html_url":"https://github.com/openmrs","followers_url":"https://api.github.com/users/openmrs/followers","following_url":"https://api.github.com/users/openmrs/following{/other_user}","gists_url":"https://api.github.com/users/openmrs/gists{/gist_id}","starred_url":"https://api.github.com/users/openmrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmrs/subscriptions","organizations_url":"https://api.github.com/users/openmrs/orgs","repos_url":"https://api.github.com/users/openmrs/repos","events_url":"https://api.github.com/users/openmrs/events{/privacy}","received_events_url":"https://api.github.com/users/openmrs/received_events","type":"Organization","site_admin":false},"repo":{"id":5187976,"name":"openmrs-core","full_name":"openmrs/openmrs-core","owner":{"login":"openmrs","id":860776,"avatar_url":"https://avatars3.githubusercontent.com/u/860776?v=4","gravatar_id":"","url":"https://api.github.com/users/openmrs","html_url":"https://github.com/openmrs","followers_url":"https://api.github.com/users/openmrs/followers","following_url":"https://api.github.com/users/openmrs/following{/other_user}","gists_url":"https://api.github.com/users/openmrs/gists{/gist_id}","starred_url":"https://api.github.com/users/openmrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openmrs/subscriptions","organizations_url":"https://api.github.com/users/openmrs/orgs","repos_url":"https://api.github.com/users/openmrs/repos","events_url":"https://api.github.com/users/openmrs/events{/privacy}","received_events_url":"https://api.github.com/users/openmrs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openmrs/openmrs-core","description":"OpenMRS API and web application code","fork":false,"url":"https://api.github.com/repos/openmrs/openmrs-core","forks_url":"https://api.github.com/repos/openmrs/openmrs-core/forks","keys_url":"https://api.github.com/repos/openmrs/openmrs-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openmrs/openmrs-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openmrs/openmrs-core/teams","hooks_url":"https://api.github.com/repos/openmrs/openmrs-core/hooks","issue_events_url":"https://api.github.com/repos/openmrs/openmrs-core/issues/events{/number}","events_url":"https://api.github.com/repos/openmrs/openmrs-core/events","assignees_url":"https://api.github.com/repos/openmrs/openmrs-core/assignees{/user}","branches_url":"https://api.github.com/repos/openmrs/openmrs-core/branches{/branch}","tags_url":"https://api.github.com/repos/openmrs/openmrs-core/tags","blobs_url":"https://api.github.com/repos/openmrs/openmrs-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openmrs/openmrs-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openmrs/openmrs-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/openmrs/openmrs-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openmrs/openmrs-core/statuses/{sha}","languages_url":"https://api.github.com/repos/openmrs/openmrs-core/languages","stargazers_url":"https://api.github.com/repos/openmrs/openmrs-core/stargazers","contributors_url":"https://api.github.com/repos/openmrs/openmrs-core/contributors","subscribers_url":"https://api.github.com/repos/openmrs/openmrs-core/subscribers","subscription_url":"https://api.github.com/repos/openmrs/openmrs-core/subscription","commits_url":"https://api.github.com/repos/openmrs/openmrs-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/openmrs/openmrs-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/openmrs/openmrs-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/openmrs/openmrs-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/openmrs/openmrs-core/contents/{+path}","compare_url":"https://api.github.com/repos/openmrs/openmrs-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openmrs/openmrs-core/merges","archive_url":"https://api.github.com/repos/openmrs/openmrs-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openmrs/openmrs-core/downloads","issues_url":"https://api.github.com/repos/openmrs/openmrs-core/issues{/number}","pulls_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls{/number}","milestones_url":"https://api.github.com/repos/openmrs/openmrs-core/milestones{/number}","notifications_url":"https://api.github.com/repos/openmrs/openmrs-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openmrs/openmrs-core/labels{/name}","releases_url":"https://api.github.com/repos/openmrs/openmrs-core/releases{/id}","deployments_url":"https://api.github.com/repos/openmrs/openmrs-core/deployments","created_at":"2012-07-26T04:54:29Z","updated_at":"2018-02-09T13:03:34Z","pushed_at":"2018-02-12T07:36:25Z","git_url":"git://github.com/openmrs/openmrs-core.git","ssh_url":"git@github.com:openmrs/openmrs-core.git","clone_url":"https://github.com/openmrs/openmrs-core.git","svn_url":"https://github.com/openmrs/openmrs-core","homepage":"http://openmrs.org","size":227201,"stargazers_count":615,"watchers_count":615,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2022,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2022,"open_issues":17,"watchers":615,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2560"},"html":{"href":"https://github.com/openmrs/openmrs-core/pull/2560"},"issue":{"href":"https://api.github.com/repos/openmrs/openmrs-core/issues/2560"},"comments":{"href":"https://api.github.com/repos/openmrs/openmrs-core/issues/2560/comments"},"review_comments":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2560/comments"},"review_comment":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2560/commits"},"statuses":{"href":"https://api.github.com/repos/openmrs/openmrs-core/statuses/f0591c512ba3353f2f9d3d9e9a2b361e11209fea"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"teleivo"}}