{"action":"created","comment":{"url":"https://api.github.com/repos/motech/modules/pulls/comments/75661295","id":75661295,"diff_hunk":"@@ -0,0 +1,67 @@\n+package org.motechproject.openmrs.tasks.builder;\n+\n+import org.junit.Before;\n+import org.junit.Test;\n+import org.mockito.Mock;\n+import org.motechproject.openmrs.config.Config;\n+import org.motechproject.openmrs.config.Configs;\n+import org.motechproject.openmrs.service.EventKeys;\n+import org.motechproject.openmrs.service.OpenMRSConfigService;\n+import org.motechproject.openmrs.tasks.constants.DisplayNames;\n+import org.motechproject.tasks.contract.TriggerEventRequest;\n+\n+import java.util.List;\n+\n+import static org.junit.Assert.assertFalse;\n+import static org.junit.Assert.assertEquals;\n+import static org.mockito.Mockito.when;\n+import static org.mockito.MockitoAnnotations.initMocks;\n+\n+public class OpenMRSTriggerBuilderTest {\n+    \n+    @Mock\n+    private OpenMRSConfigService configService;\n+\n+    private Configs configs;\n+\n+    private OpenMRSTriggerBuilder triggerBuilder;\n+\n+    private static final String CONFIG_NAME = \"openmrs\";\n+\n+    @Before\n+    public void setUp() {\n+        initMocks(this);\n+        configs = prepareConfigs();\n+        when(configService.getConfigs()).thenReturn(configs);\n+        triggerBuilder = new OpenMRSTriggerBuilder(configService);\n+    }\n+\n+    @Test\n+    public void shouldBuildProperTriggerEventRequests() {\n+        List<TriggerEventRequest> triggerEventRequests = triggerBuilder.buildTriggers();\n+        assertFalse(triggerEventRequests.isEmpty());\n+\n+        assertEquals(3, triggerEventRequests.get(0).getEventParameters().size());","path":"openmrs/src/test/java/org/motechproject/openmrs/tasks/builder/OpenMRSTriggerBuilderTest.java","position":44,"original_position":44,"commit_id":"8aa7816ef65fbc4345ebe91f6bada6fc274529bf","original_commit_id":"8aa7816ef65fbc4345ebe91f6bada6fc274529bf","user":{"login":"kmadej","id":9861925,"avatar_url":"https://avatars.githubusercontent.com/u/9861925?v=3","gravatar_id":"","url":"https://api.github.com/users/kmadej","html_url":"https://github.com/kmadej","followers_url":"https://api.github.com/users/kmadej/followers","following_url":"https://api.github.com/users/kmadej/following{/other_user}","gists_url":"https://api.github.com/users/kmadej/gists{/gist_id}","starred_url":"https://api.github.com/users/kmadej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmadej/subscriptions","organizations_url":"https://api.github.com/users/kmadej/orgs","repos_url":"https://api.github.com/users/kmadej/repos","events_url":"https://api.github.com/users/kmadej/events{/privacy}","received_events_url":"https://api.github.com/users/kmadej/received_events","type":"User","site_admin":false},"body":"you should verify if appropriate event parameters are added to trigger","created_at":"2016-08-22T11:34:26Z","updated_at":"2016-08-22T11:34:26Z","html_url":"https://github.com/motech/modules/pull/390#discussion_r75661295","pull_request_url":"https://api.github.com/repos/motech/modules/pulls/390","_links":{"self":{"href":"https://api.github.com/repos/motech/modules/pulls/comments/75661295"},"html":{"href":"https://github.com/motech/modules/pull/390#discussion_r75661295"},"pull_request":{"href":"https://api.github.com/repos/motech/modules/pulls/390"}}},"pull_request":{"url":"https://api.github.com/repos/motech/modules/pulls/390","id":81655683,"html_url":"https://github.com/motech/modules/pull/390","diff_url":"https://github.com/motech/modules/pull/390.diff","patch_url":"https://github.com/motech/modules/pull/390.patch","issue_url":"https://api.github.com/repos/motech/modules/issues/390","number":390,"state":"open","locked":false,"title":"MOTECH-2839: Added Cohort Query Member Task Trigger - Unit Tests","user":{"login":"afijal","id":2682379,"avatar_url":"https://avatars.githubusercontent.com/u/2682379?v=3","gravatar_id":"","url":"https://api.github.com/users/afijal","html_url":"https://github.com/afijal","followers_url":"https://api.github.com/users/afijal/followers","following_url":"https://api.github.com/users/afijal/following{/other_user}","gists_url":"https://api.github.com/users/afijal/gists{/gist_id}","starred_url":"https://api.github.com/users/afijal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afijal/subscriptions","organizations_url":"https://api.github.com/users/afijal/orgs","repos_url":"https://api.github.com/users/afijal/repos","events_url":"https://api.github.com/users/afijal/events{/privacy}","received_events_url":"https://api.github.com/users/afijal/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-17T14:43:26Z","updated_at":"2016-08-22T11:34:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0370104fe5a57568510063b56c28caf91bd59e05","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/motech/modules/pulls/390/commits","review_comments_url":"https://api.github.com/repos/motech/modules/pulls/390/comments","review_comment_url":"https://api.github.com/repos/motech/modules/pulls/comments{/number}","comments_url":"https://api.github.com/repos/motech/modules/issues/390/comments","statuses_url":"https://api.github.com/repos/motech/modules/statuses/8aa7816ef65fbc4345ebe91f6bada6fc274529bf","head":{"label":"afijal:MOTECH-2839tests","ref":"MOTECH-2839tests","sha":"8aa7816ef65fbc4345ebe91f6bada6fc274529bf","user":{"login":"afijal","id":2682379,"avatar_url":"https://avatars.githubusercontent.com/u/2682379?v=3","gravatar_id":"","url":"https://api.github.com/users/afijal","html_url":"https://github.com/afijal","followers_url":"https://api.github.com/users/afijal/followers","following_url":"https://api.github.com/users/afijal/following{/other_user}","gists_url":"https://api.github.com/users/afijal/gists{/gist_id}","starred_url":"https://api.github.com/users/afijal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afijal/subscriptions","organizations_url":"https://api.github.com/users/afijal/orgs","repos_url":"https://api.github.com/users/afijal/repos","events_url":"https://api.github.com/users/afijal/events{/privacy}","received_events_url":"https://api.github.com/users/afijal/received_events","type":"User","site_admin":false},"repo":{"id":62393673,"name":"modules","full_name":"afijal/modules","owner":{"login":"afijal","id":2682379,"avatar_url":"https://avatars.githubusercontent.com/u/2682379?v=3","gravatar_id":"","url":"https://api.github.com/users/afijal","html_url":"https://github.com/afijal","followers_url":"https://api.github.com/users/afijal/followers","following_url":"https://api.github.com/users/afijal/following{/other_user}","gists_url":"https://api.github.com/users/afijal/gists{/gist_id}","starred_url":"https://api.github.com/users/afijal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afijal/subscriptions","organizations_url":"https://api.github.com/users/afijal/orgs","repos_url":"https://api.github.com/users/afijal/repos","events_url":"https://api.github.com/users/afijal/events{/privacy}","received_events_url":"https://api.github.com/users/afijal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/afijal/modules","description":" Mobile Technology for Community Health - Modules","fork":true,"url":"https://api.github.com/repos/afijal/modules","forks_url":"https://api.github.com/repos/afijal/modules/forks","keys_url":"https://api.github.com/repos/afijal/modules/keys{/key_id}","collaborators_url":"https://api.github.com/repos/afijal/modules/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/afijal/modules/teams","hooks_url":"https://api.github.com/repos/afijal/modules/hooks","issue_events_url":"https://api.github.com/repos/afijal/modules/issues/events{/number}","events_url":"https://api.github.com/repos/afijal/modules/events","assignees_url":"https://api.github.com/repos/afijal/modules/assignees{/user}","branches_url":"https://api.github.com/repos/afijal/modules/branches{/branch}","tags_url":"https://api.github.com/repos/afijal/modules/tags","blobs_url":"https://api.github.com/repos/afijal/modules/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/afijal/modules/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/afijal/modules/git/refs{/sha}","trees_url":"https://api.github.com/repos/afijal/modules/git/trees{/sha}","statuses_url":"https://api.github.com/repos/afijal/modules/statuses/{sha}","languages_url":"https://api.github.com/repos/afijal/modules/languages","stargazers_url":"https://api.github.com/repos/afijal/modules/stargazers","contributors_url":"https://api.github.com/repos/afijal/modules/contributors","subscribers_url":"https://api.github.com/repos/afijal/modules/subscribers","subscription_url":"https://api.github.com/repos/afijal/modules/subscription","commits_url":"https://api.github.com/repos/afijal/modules/commits{/sha}","git_commits_url":"https://api.github.com/repos/afijal/modules/git/commits{/sha}","comments_url":"https://api.github.com/repos/afijal/modules/comments{/number}","issue_comment_url":"https://api.github.com/repos/afijal/modules/issues/comments{/number}","contents_url":"https://api.github.com/repos/afijal/modules/contents/{+path}","compare_url":"https://api.github.com/repos/afijal/modules/compare/{base}...{head}","merges_url":"https://api.github.com/repos/afijal/modules/merges","archive_url":"https://api.github.com/repos/afijal/modules/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/afijal/modules/downloads","issues_url":"https://api.github.com/repos/afijal/modules/issues{/number}","pulls_url":"https://api.github.com/repos/afijal/modules/pulls{/number}","milestones_url":"https://api.github.com/repos/afijal/modules/milestones{/number}","notifications_url":"https://api.github.com/repos/afijal/modules/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/afijal/modules/labels{/name}","releases_url":"https://api.github.com/repos/afijal/modules/releases{/id}","deployments_url":"https://api.github.com/repos/afijal/modules/deployments","created_at":"2016-07-01T13:07:59Z","updated_at":"2016-07-01T13:08:06Z","pushed_at":"2016-08-19T13:32:20Z","git_url":"git://github.com/afijal/modules.git","ssh_url":"git@github.com:afijal/modules.git","clone_url":"https://github.com/afijal/modules.git","svn_url":"https://github.com/afijal/modules","homepage":"http://modules.motechproject.org","size":34141,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"motech:0.29.X","ref":"0.29.X","sha":"86c062248dbf68a6716692104b1c2f00811001aa","user":{"login":"motech","id":477919,"avatar_url":"https://avatars.githubusercontent.com/u/477919?v=3","gravatar_id":"","url":"https://api.github.com/users/motech","html_url":"https://github.com/motech","followers_url":"https://api.github.com/users/motech/followers","following_url":"https://api.github.com/users/motech/following{/other_user}","gists_url":"https://api.github.com/users/motech/gists{/gist_id}","starred_url":"https://api.github.com/users/motech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motech/subscriptions","organizations_url":"https://api.github.com/users/motech/orgs","repos_url":"https://api.github.com/users/motech/repos","events_url":"https://api.github.com/users/motech/events{/privacy}","received_events_url":"https://api.github.com/users/motech/received_events","type":"Organization","site_admin":false},"repo":{"id":19785525,"name":"modules","full_name":"motech/modules","owner":{"login":"motech","id":477919,"avatar_url":"https://avatars.githubusercontent.com/u/477919?v=3","gravatar_id":"","url":"https://api.github.com/users/motech","html_url":"https://github.com/motech","followers_url":"https://api.github.com/users/motech/followers","following_url":"https://api.github.com/users/motech/following{/other_user}","gists_url":"https://api.github.com/users/motech/gists{/gist_id}","starred_url":"https://api.github.com/users/motech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motech/subscriptions","organizations_url":"https://api.github.com/users/motech/orgs","repos_url":"https://api.github.com/users/motech/repos","events_url":"https://api.github.com/users/motech/events{/privacy}","received_events_url":"https://api.github.com/users/motech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/motech/modules","description":" Mobile Technology for Community Health - Modules","fork":false,"url":"https://api.github.com/repos/motech/modules","forks_url":"https://api.github.com/repos/motech/modules/forks","keys_url":"https://api.github.com/repos/motech/modules/keys{/key_id}","collaborators_url":"https://api.github.com/repos/motech/modules/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/motech/modules/teams","hooks_url":"https://api.github.com/repos/motech/modules/hooks","issue_events_url":"https://api.github.com/repos/motech/modules/issues/events{/number}","events_url":"https://api.github.com/repos/motech/modules/events","assignees_url":"https://api.github.com/repos/motech/modules/assignees{/user}","branches_url":"https://api.github.com/repos/motech/modules/branches{/branch}","tags_url":"https://api.github.com/repos/motech/modules/tags","blobs_url":"https://api.github.com/repos/motech/modules/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/motech/modules/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/motech/modules/git/refs{/sha}","trees_url":"https://api.github.com/repos/motech/modules/git/trees{/sha}","statuses_url":"https://api.github.com/repos/motech/modules/statuses/{sha}","languages_url":"https://api.github.com/repos/motech/modules/languages","stargazers_url":"https://api.github.com/repos/motech/modules/stargazers","contributors_url":"https://api.github.com/repos/motech/modules/contributors","subscribers_url":"https://api.github.com/repos/motech/modules/subscribers","subscription_url":"https://api.github.com/repos/motech/modules/subscription","commits_url":"https://api.github.com/repos/motech/modules/commits{/sha}","git_commits_url":"https://api.github.com/repos/motech/modules/git/commits{/sha}","comments_url":"https://api.github.com/repos/motech/modules/comments{/number}","issue_comment_url":"https://api.github.com/repos/motech/modules/issues/comments{/number}","contents_url":"https://api.github.com/repos/motech/modules/contents/{+path}","compare_url":"https://api.github.com/repos/motech/modules/compare/{base}...{head}","merges_url":"https://api.github.com/repos/motech/modules/merges","archive_url":"https://api.github.com/repos/motech/modules/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/motech/modules/downloads","issues_url":"https://api.github.com/repos/motech/modules/issues{/number}","pulls_url":"https://api.github.com/repos/motech/modules/pulls{/number}","milestones_url":"https://api.github.com/repos/motech/modules/milestones{/number}","notifications_url":"https://api.github.com/repos/motech/modules/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/motech/modules/labels{/name}","releases_url":"https://api.github.com/repos/motech/modules/releases{/id}","deployments_url":"https://api.github.com/repos/motech/modules/deployments","created_at":"2014-05-14T15:41:17Z","updated_at":"2016-03-01T02:21:35Z","pushed_at":"2016-08-22T07:32:17Z","git_url":"git://github.com/motech/modules.git","ssh_url":"git@github.com:motech/modules.git","clone_url":"https://github.com/motech/modules.git","svn_url":"https://github.com/motech/modules","homepage":"http://modules.motechproject.org","size":40198,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":10,"forks":53,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/motech/modules/pulls/390"},"html":{"href":"https://github.com/motech/modules/pull/390"},"issue":{"href":"https://api.github.com/repos/motech/modules/issues/390"},"comments":{"href":"https://api.github.com/repos/motech/modules/issues/390/comments"},"review_comments":{"href":"https://api.github.com/repos/motech/modules/pulls/390/comments"},"review_comment":{"href":"https://api.github.com/repos/motech/modules/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/motech/modules/pulls/390/commits"},"statuses":{"href":"https://api.github.com/repos/motech/modules/statuses/8aa7816ef65fbc4345ebe91f6bada6fc274529bf"}}}}
{"actor":{"display_login":"kmadej"}}