{"action":"created","comment":{"url":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls/comments/70097294","id":70097294,"diff_hunk":"@@ -0,0 +1,62 @@\n+/**\n+ *\n+ */\n+package org.bonstore.core.event;\n+\n+import static org.junit.Assert.assertEquals;\n+import static org.mockito.BDDMockito.given;\n+import static org.mockito.Matchers.anyString;\n+import static org.mockito.Mockito.doNothing;\n+import static org.mockito.Mockito.when;\n+\n+import de.hybris.bootstrap.annotations.UnitTest;\n+import de.hybris.platform.core.model.user.CustomerModel;\n+import de.hybris.platform.servicelayer.model.ModelService;\n+import de.hybris.platform.servicelayer.user.UserService;\n+\n+import org.junit.Before;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.mockito.InjectMocks;\n+import org.mockito.Mock;\n+import org.mockito.runners.MockitoJUnitRunner;\n+\n+\n+/**\n+ * @author Tanmoy_Mondal\n+ *\n+ */\n+@UnitTest\n+@RunWith(MockitoJUnitRunner.class)\n+public class CustomerEventListenerTest\n+{\n+\n+\t@Mock\n+\tprivate ModelService modelService;\n+\t@Mock\n+\tprivate UserService userService;\n+\t@Mock\n+\tprivate CustomerModel customerModel;\n+\t@Mock\n+\tprivate LoginChangeEvent loginChangeEvent;\n+\t@InjectMocks\n+\tprivate CustomerEventListener customerEventListener;\n+\n+\t@Before\n+\tpublic void setUp()\n+\t{\n+\t\twhen(userService.getUserForUID(anyString())).thenReturn(customerModel);\n+\t\tdoNothing().when(modelService).save(customerModel);\n+\t\tgiven(customerModel.getAttemptCount()).willReturn(0);\n+\t\tgiven(customerModel.isStatus()).willReturn(false);\n+\t}\n+\n+\t@Test\n+\tpublic void testOnEvent()\n+\t{\n+\t\tcustomerEventListener.onEvent(loginChangeEvent);\n+\t\tassertEquals(0, customerModel.getAttemptCount());","path":"hybrisCustom/custom-ext/bonstore/bonstorecore/testsrc/org/bonstore/core/event/CustomerEventListenerTest.java","position":58,"original_position":58,"commit_id":"d5203dfb8724aa9bc9238013d6a4cac319241daf","original_commit_id":"d5203dfb8724aa9bc9238013d6a4cac319241daf","user":{"login":"SergiyMishkovets","id":14939008,"avatar_url":"https://avatars.githubusercontent.com/u/14939008?v=3","gravatar_id":"","url":"https://api.github.com/users/SergiyMishkovets","html_url":"https://github.com/SergiyMishkovets","followers_url":"https://api.github.com/users/SergiyMishkovets/followers","following_url":"https://api.github.com/users/SergiyMishkovets/following{/other_user}","gists_url":"https://api.github.com/users/SergiyMishkovets/gists{/gist_id}","starred_url":"https://api.github.com/users/SergiyMishkovets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergiyMishkovets/subscriptions","organizations_url":"https://api.github.com/users/SergiyMishkovets/orgs","repos_url":"https://api.github.com/users/SergiyMishkovets/repos","events_url":"https://api.github.com/users/SergiyMishkovets/events{/privacy}","received_events_url":"https://api.github.com/users/SergiyMishkovets/received_events","type":"User","site_admin":false},"body":"this test would be always green because customer Model is mocked object and getAttemptCount returns 0, isStatus returns false","created_at":"2016-07-08T15:57:09Z","updated_at":"2016-07-08T15:57:09Z","html_url":"https://github.com/tanmoymondal/hybtelco/pull/3#discussion_r70097294","pull_request_url":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls/comments/70097294"},"html":{"href":"https://github.com/tanmoymondal/hybtelco/pull/3#discussion_r70097294"},"pull_request":{"href":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls/3","id":76769678,"html_url":"https://github.com/tanmoymondal/hybtelco/pull/3","diff_url":"https://github.com/tanmoymondal/hybtelco/pull/3.diff","patch_url":"https://github.com/tanmoymondal/hybtelco/pull/3.patch","issue_url":"https://api.github.com/repos/tanmoymondal/hybtelco/issues/3","number":3,"state":"open","locked":false,"title":"Task4.4","user":{"login":"SergiyMishkovets","id":14939008,"avatar_url":"https://avatars.githubusercontent.com/u/14939008?v=3","gravatar_id":"","url":"https://api.github.com/users/SergiyMishkovets","html_url":"https://github.com/SergiyMishkovets","followers_url":"https://api.github.com/users/SergiyMishkovets/followers","following_url":"https://api.github.com/users/SergiyMishkovets/following{/other_user}","gists_url":"https://api.github.com/users/SergiyMishkovets/gists{/gist_id}","starred_url":"https://api.github.com/users/SergiyMishkovets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergiyMishkovets/subscriptions","organizations_url":"https://api.github.com/users/SergiyMishkovets/orgs","repos_url":"https://api.github.com/users/SergiyMishkovets/repos","events_url":"https://api.github.com/users/SergiyMishkovets/events{/privacy}","received_events_url":"https://api.github.com/users/SergiyMishkovets/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-08T15:22:50Z","updated_at":"2016-07-08T15:57:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"480f27802d172bbb50c133a389b7c258badfbd98","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls/3/commits","review_comments_url":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls/3/comments","review_comment_url":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tanmoymondal/hybtelco/issues/3/comments","statuses_url":"https://api.github.com/repos/tanmoymondal/hybtelco/statuses/d5203dfb8724aa9bc9238013d6a4cac319241daf","head":{"label":"tanmoymondal:task4.4","ref":"task4.4","sha":"d5203dfb8724aa9bc9238013d6a4cac319241daf","user":{"login":"tanmoymondal","id":19776857,"avatar_url":"https://avatars.githubusercontent.com/u/19776857?v=3","gravatar_id":"","url":"https://api.github.com/users/tanmoymondal","html_url":"https://github.com/tanmoymondal","followers_url":"https://api.github.com/users/tanmoymondal/followers","following_url":"https://api.github.com/users/tanmoymondal/following{/other_user}","gists_url":"https://api.github.com/users/tanmoymondal/gists{/gist_id}","starred_url":"https://api.github.com/users/tanmoymondal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanmoymondal/subscriptions","organizations_url":"https://api.github.com/users/tanmoymondal/orgs","repos_url":"https://api.github.com/users/tanmoymondal/repos","events_url":"https://api.github.com/users/tanmoymondal/events{/privacy}","received_events_url":"https://api.github.com/users/tanmoymondal/received_events","type":"User","site_admin":false},"repo":{"id":60526476,"name":"hybtelco","full_name":"tanmoymondal/hybtelco","owner":{"login":"tanmoymondal","id":19776857,"avatar_url":"https://avatars.githubusercontent.com/u/19776857?v=3","gravatar_id":"","url":"https://api.github.com/users/tanmoymondal","html_url":"https://github.com/tanmoymondal","followers_url":"https://api.github.com/users/tanmoymondal/followers","following_url":"https://api.github.com/users/tanmoymondal/following{/other_user}","gists_url":"https://api.github.com/users/tanmoymondal/gists{/gist_id}","starred_url":"https://api.github.com/users/tanmoymondal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanmoymondal/subscriptions","organizations_url":"https://api.github.com/users/tanmoymondal/orgs","repos_url":"https://api.github.com/users/tanmoymondal/repos","events_url":"https://api.github.com/users/tanmoymondal/events{/privacy}","received_events_url":"https://api.github.com/users/tanmoymondal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tanmoymondal/hybtelco","description":"","fork":true,"url":"https://api.github.com/repos/tanmoymondal/hybtelco","forks_url":"https://api.github.com/repos/tanmoymondal/hybtelco/forks","keys_url":"https://api.github.com/repos/tanmoymondal/hybtelco/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tanmoymondal/hybtelco/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tanmoymondal/hybtelco/teams","hooks_url":"https://api.github.com/repos/tanmoymondal/hybtelco/hooks","issue_events_url":"https://api.github.com/repos/tanmoymondal/hybtelco/issues/events{/number}","events_url":"https://api.github.com/repos/tanmoymondal/hybtelco/events","assignees_url":"https://api.github.com/repos/tanmoymondal/hybtelco/assignees{/user}","branches_url":"https://api.github.com/repos/tanmoymondal/hybtelco/branches{/branch}","tags_url":"https://api.github.com/repos/tanmoymondal/hybtelco/tags","blobs_url":"https://api.github.com/repos/tanmoymondal/hybtelco/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tanmoymondal/hybtelco/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tanmoymondal/hybtelco/git/refs{/sha}","trees_url":"https://api.github.com/repos/tanmoymondal/hybtelco/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tanmoymondal/hybtelco/statuses/{sha}","languages_url":"https://api.github.com/repos/tanmoymondal/hybtelco/languages","stargazers_url":"https://api.github.com/repos/tanmoymondal/hybtelco/stargazers","contributors_url":"https://api.github.com/repos/tanmoymondal/hybtelco/contributors","subscribers_url":"https://api.github.com/repos/tanmoymondal/hybtelco/subscribers","subscription_url":"https://api.github.com/repos/tanmoymondal/hybtelco/subscription","commits_url":"https://api.github.com/repos/tanmoymondal/hybtelco/commits{/sha}","git_commits_url":"https://api.github.com/repos/tanmoymondal/hybtelco/git/commits{/sha}","comments_url":"https://api.github.com/repos/tanmoymondal/hybtelco/comments{/number}","issue_comment_url":"https://api.github.com/repos/tanmoymondal/hybtelco/issues/comments{/number}","contents_url":"https://api.github.com/repos/tanmoymondal/hybtelco/contents/{+path}","compare_url":"https://api.github.com/repos/tanmoymondal/hybtelco/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tanmoymondal/hybtelco/merges","archive_url":"https://api.github.com/repos/tanmoymondal/hybtelco/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tanmoymondal/hybtelco/downloads","issues_url":"https://api.github.com/repos/tanmoymondal/hybtelco/issues{/number}","pulls_url":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls{/number}","milestones_url":"https://api.github.com/repos/tanmoymondal/hybtelco/milestones{/number}","notifications_url":"https://api.github.com/repos/tanmoymondal/hybtelco/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tanmoymondal/hybtelco/labels{/name}","releases_url":"https://api.github.com/repos/tanmoymondal/hybtelco/releases{/id}","deployments_url":"https://api.github.com/repos/tanmoymondal/hybtelco/deployments","created_at":"2016-06-06T12:35:06Z","updated_at":"2016-06-06T12:01:59Z","pushed_at":"2016-07-08T15:22:50Z","git_url":"git://github.com/tanmoymondal/hybtelco.git","ssh_url":"git@github.com:tanmoymondal/hybtelco.git","clone_url":"https://github.com/tanmoymondal/hybtelco.git","svn_url":"https://github.com/tanmoymondal/hybtelco","homepage":null,"size":6433,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"tanmoymondal:develop","ref":"develop","sha":"da716ec520f4437e652f05157c3a59060e18fe5e","user":{"login":"tanmoymondal","id":19776857,"avatar_url":"https://avatars.githubusercontent.com/u/19776857?v=3","gravatar_id":"","url":"https://api.github.com/users/tanmoymondal","html_url":"https://github.com/tanmoymondal","followers_url":"https://api.github.com/users/tanmoymondal/followers","following_url":"https://api.github.com/users/tanmoymondal/following{/other_user}","gists_url":"https://api.github.com/users/tanmoymondal/gists{/gist_id}","starred_url":"https://api.github.com/users/tanmoymondal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanmoymondal/subscriptions","organizations_url":"https://api.github.com/users/tanmoymondal/orgs","repos_url":"https://api.github.com/users/tanmoymondal/repos","events_url":"https://api.github.com/users/tanmoymondal/events{/privacy}","received_events_url":"https://api.github.com/users/tanmoymondal/received_events","type":"User","site_admin":false},"repo":{"id":60526476,"name":"hybtelco","full_name":"tanmoymondal/hybtelco","owner":{"login":"tanmoymondal","id":19776857,"avatar_url":"https://avatars.githubusercontent.com/u/19776857?v=3","gravatar_id":"","url":"https://api.github.com/users/tanmoymondal","html_url":"https://github.com/tanmoymondal","followers_url":"https://api.github.com/users/tanmoymondal/followers","following_url":"https://api.github.com/users/tanmoymondal/following{/other_user}","gists_url":"https://api.github.com/users/tanmoymondal/gists{/gist_id}","starred_url":"https://api.github.com/users/tanmoymondal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanmoymondal/subscriptions","organizations_url":"https://api.github.com/users/tanmoymondal/orgs","repos_url":"https://api.github.com/users/tanmoymondal/repos","events_url":"https://api.github.com/users/tanmoymondal/events{/privacy}","received_events_url":"https://api.github.com/users/tanmoymondal/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tanmoymondal/hybtelco","description":"","fork":true,"url":"https://api.github.com/repos/tanmoymondal/hybtelco","forks_url":"https://api.github.com/repos/tanmoymondal/hybtelco/forks","keys_url":"https://api.github.com/repos/tanmoymondal/hybtelco/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tanmoymondal/hybtelco/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tanmoymondal/hybtelco/teams","hooks_url":"https://api.github.com/repos/tanmoymondal/hybtelco/hooks","issue_events_url":"https://api.github.com/repos/tanmoymondal/hybtelco/issues/events{/number}","events_url":"https://api.github.com/repos/tanmoymondal/hybtelco/events","assignees_url":"https://api.github.com/repos/tanmoymondal/hybtelco/assignees{/user}","branches_url":"https://api.github.com/repos/tanmoymondal/hybtelco/branches{/branch}","tags_url":"https://api.github.com/repos/tanmoymondal/hybtelco/tags","blobs_url":"https://api.github.com/repos/tanmoymondal/hybtelco/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tanmoymondal/hybtelco/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tanmoymondal/hybtelco/git/refs{/sha}","trees_url":"https://api.github.com/repos/tanmoymondal/hybtelco/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tanmoymondal/hybtelco/statuses/{sha}","languages_url":"https://api.github.com/repos/tanmoymondal/hybtelco/languages","stargazers_url":"https://api.github.com/repos/tanmoymondal/hybtelco/stargazers","contributors_url":"https://api.github.com/repos/tanmoymondal/hybtelco/contributors","subscribers_url":"https://api.github.com/repos/tanmoymondal/hybtelco/subscribers","subscription_url":"https://api.github.com/repos/tanmoymondal/hybtelco/subscription","commits_url":"https://api.github.com/repos/tanmoymondal/hybtelco/commits{/sha}","git_commits_url":"https://api.github.com/repos/tanmoymondal/hybtelco/git/commits{/sha}","comments_url":"https://api.github.com/repos/tanmoymondal/hybtelco/comments{/number}","issue_comment_url":"https://api.github.com/repos/tanmoymondal/hybtelco/issues/comments{/number}","contents_url":"https://api.github.com/repos/tanmoymondal/hybtelco/contents/{+path}","compare_url":"https://api.github.com/repos/tanmoymondal/hybtelco/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tanmoymondal/hybtelco/merges","archive_url":"https://api.github.com/repos/tanmoymondal/hybtelco/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tanmoymondal/hybtelco/downloads","issues_url":"https://api.github.com/repos/tanmoymondal/hybtelco/issues{/number}","pulls_url":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls{/number}","milestones_url":"https://api.github.com/repos/tanmoymondal/hybtelco/milestones{/number}","notifications_url":"https://api.github.com/repos/tanmoymondal/hybtelco/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tanmoymondal/hybtelco/labels{/name}","releases_url":"https://api.github.com/repos/tanmoymondal/hybtelco/releases{/id}","deployments_url":"https://api.github.com/repos/tanmoymondal/hybtelco/deployments","created_at":"2016-06-06T12:35:06Z","updated_at":"2016-06-06T12:01:59Z","pushed_at":"2016-07-08T15:22:50Z","git_url":"git://github.com/tanmoymondal/hybtelco.git","ssh_url":"git@github.com:tanmoymondal/hybtelco.git","clone_url":"https://github.com/tanmoymondal/hybtelco.git","svn_url":"https://github.com/tanmoymondal/hybtelco","homepage":null,"size":6433,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls/3"},"html":{"href":"https://github.com/tanmoymondal/hybtelco/pull/3"},"issue":{"href":"https://api.github.com/repos/tanmoymondal/hybtelco/issues/3"},"comments":{"href":"https://api.github.com/repos/tanmoymondal/hybtelco/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tanmoymondal/hybtelco/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/tanmoymondal/hybtelco/statuses/d5203dfb8724aa9bc9238013d6a4cac319241daf"}}}}
{"actor":{"display_login":"SergiyMishkovets"}}