payload: {"action":"created","comment":{"url":"https://api.github.com/repos/marcinogo/robot/pulls/comments/316060426","pull_request_review_id":277617244,"id":316060426,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxNjA2MDQyNg==","diff_hunk":"@@ -14,29 +14,35 @@\n import java.util.Optional;\n import java.util.Set;\n \n+import static org.mockito.ArgumentMatchers.any;\n+import static org.mockito.ArgumentMatchers.eq;\n import static org.mockito.Mockito.*;\n \n-/** @author Patryk Kucharski */\n+\n @RunWith(MockitoJUnitRunner.class)\n public class AuthenticationServiceTest {\n-  @Mock UserRepository userRepository;\n-  @Mock RoleRepository roleRepository;\n-  @Mock PasswordEncoder encoder;\n-\n-  @InjectMocks private AuthenticationService authenticationService;\n-\n-  @Test\n-  public void testCreateNewAccount() {\n-    Role role = new Role();\n-    role.setId(1L);\n-    role.setName(RoleName.ROLE_USER);\n-    when(this.encoder.encode(\"test\")).thenReturn(\"encoded\");\n-    when(roleRepository.findByName(any())).thenReturn(Optional.of(role));\n-    User user = new User(\"test@test.com\", \"test\", encoder.encode(\"test\"), Set.of(role));\n-\n-    when(userRepository.saveUser(eq(user))).thenReturn(true);\n-    authenticationService.createNewAccount(\n-        new RegisterForm(\"test@test.com\", \"test\", Set.of(\"user\"), \"test\"));\n-    verify(userRepository, times(1)).saveUser(user);\n-  }\n+    @Mock\n+    UserRepository userRepository;\n+    @Mock\n+    RoleRepository roleRepository;\n+    @Mock\n+    PasswordEncoder encoder;\n+\n+    @InjectMocks\n+    private AuthenticationService authenticationService;\n+\n+    @Test\n+    public void testCreateNewAccount() {","path":"src/test/java/edition/academy/seventh/security/AuthenticationServiceTest.java","position":43,"original_position":43,"commit_id":"db7d4dec3386c6473627b4d2984ebbe4d55e5f2f","original_commit_id":"db7d4dec3386c6473627b4d2984ebbe4d55e5f2f","user":{"login":"marcinogo","id":27285215,"node_id":"MDQ6VXNlcjI3Mjg1MjE1","avatar_url":"https://avatars1.githubusercontent.com/u/27285215?v=4","gravatar_id":"","url":"https://api.github.com/users/marcinogo","html_url":"https://github.com/marcinogo","followers_url":"https://api.github.com/users/marcinogo/followers","following_url":"https://api.github.com/users/marcinogo/following{/other_user}","gists_url":"https://api.github.com/users/marcinogo/gists{/gist_id}","starred_url":"https://api.github.com/users/marcinogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcinogo/subscriptions","organizations_url":"https://api.github.com/users/marcinogo/orgs","repos_url":"https://api.github.com/users/marcinogo/repos","events_url":"https://api.github.com/users/marcinogo/events{/privacy}","received_events_url":"https://api.github.com/users/marcinogo/received_events","type":"User","site_admin":false},"body":"Może podzielić na  sekcje AAA albo GWT","created_at":"2019-08-21T08:36:07Z","updated_at":"2019-08-21T08:44:32Z","html_url":"https://github.com/marcinogo/robot/pull/259#discussion_r316060426","pull_request_url":"https://api.github.com/repos/marcinogo/robot/pulls/259","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/marcinogo/robot/pulls/comments/316060426"},"html":{"href":"https://github.com/marcinogo/robot/pull/259#discussion_r316060426"},"pull_request":{"href":"https://api.github.com/repos/marcinogo/robot/pulls/259"}}},"pull_request":{"url":"https://api.github.com/repos/marcinogo/robot/pulls/259","id":309361014,"node_id":"MDExOlB1bGxSZXF1ZXN0MzA5MzYxMDE0","html_url":"https://github.com/marcinogo/robot/pull/259","diff_url":"https://github.com/marcinogo/robot/pull/259.diff","patch_url":"https://github.com/marcinogo/robot/pull/259.patch","issue_url":"https://api.github.com/repos/marcinogo/robot/issues/259","number":259,"state":"open","locked":false,"title":"Closes #248","user":{"login":"ksundaysky","id":22611592,"node_id":"MDQ6VXNlcjIyNjExNTky","avatar_url":"https://avatars3.githubusercontent.com/u/22611592?v=4","gravatar_id":"","url":"https://api.github.com/users/ksundaysky","html_url":"https://github.com/ksundaysky","followers_url":"https://api.github.com/users/ksundaysky/followers","following_url":"https://api.github.com/users/ksundaysky/following{/other_user}","gists_url":"https://api.github.com/users/ksundaysky/gists{/gist_id}","starred_url":"https://api.github.com/users/ksundaysky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksundaysky/subscriptions","organizations_url":"https://api.github.com/users/ksundaysky/orgs","repos_url":"https://api.github.com/users/ksundaysky/repos","events_url":"https://api.github.com/users/ksundaysky/events{/privacy}","received_events_url":"https://api.github.com/users/ksundaysky/received_events","type":"User","site_admin":false},"body":"Sprint#5 Task#248 Dodanie testów JWT oraz poprawa inicjalizacji bazy danych\r\n\r\n-inicjalizacja danych poprzez plik z właściwościami\r\n-usunięcie zamykania połączenia\r\n-zamykanie entityManagera\r\n-testy integracyjne autentykacja","created_at":"2019-08-21T07:29:52Z","updated_at":"2019-08-21T08:44:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9acc80594f1dbdebcf2e411c2c49c412d4d7d1da","assignee":null,"assignees":[],"requested_reviewers":[{"login":"atrzewik","id":42387362,"node_id":"MDQ6VXNlcjQyMzg3MzYy","avatar_url":"https://avatars0.githubusercontent.com/u/42387362?v=4","gravatar_id":"","url":"https://api.github.com/users/atrzewik","html_url":"https://github.com/atrzewik","followers_url":"https://api.github.com/users/atrzewik/followers","following_url":"https://api.github.com/users/atrzewik/following{/other_user}","gists_url":"https://api.github.com/users/atrzewik/gists{/gist_id}","starred_url":"https://api.github.com/users/atrzewik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atrzewik/subscriptions","organizations_url":"https://api.github.com/users/atrzewik/orgs","repos_url":"https://api.github.com/users/atrzewik/repos","events_url":"https://api.github.com/users/atrzewik/events{/privacy}","received_events_url":"https://api.github.com/users/atrzewik/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/marcinogo/robot/pulls/259/commits","review_comments_url":"https://api.github.com/repos/marcinogo/robot/pulls/259/comments","review_comment_url":"https://api.github.com/repos/marcinogo/robot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marcinogo/robot/issues/259/comments","statuses_url":"https://api.github.com/repos/marcinogo/robot/statuses/db7d4dec3386c6473627b4d2984ebbe4d55e5f2f","head":{"label":"marcinogo:248#stworzenie_testów_autentykacji","ref":"248#stworzenie_testów_autentykacji","sha":"db7d4dec3386c6473627b4d2984ebbe4d55e5f2f","user":{"login":"marcinogo","id":27285215,"node_id":"MDQ6VXNlcjI3Mjg1MjE1","avatar_url":"https://avatars1.githubusercontent.com/u/27285215?v=4","gravatar_id":"","url":"https://api.github.com/users/marcinogo","html_url":"https://github.com/marcinogo","followers_url":"https://api.github.com/users/marcinogo/followers","following_url":"https://api.github.com/users/marcinogo/following{/other_user}","gists_url":"https://api.github.com/users/marcinogo/gists{/gist_id}","starred_url":"https://api.github.com/users/marcinogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcinogo/subscriptions","organizations_url":"https://api.github.com/users/marcinogo/orgs","repos_url":"https://api.github.com/users/marcinogo/repos","events_url":"https://api.github.com/users/marcinogo/events{/privacy}","received_events_url":"https://api.github.com/users/marcinogo/received_events","type":"User","site_admin":false},"repo":{"id":195818854,"node_id":"MDEwOlJlcG9zaXRvcnkxOTU4MTg4NTQ=","name":"robot","full_name":"marcinogo/robot","private":false,"owner":{"login":"marcinogo","id":27285215,"node_id":"MDQ6VXNlcjI3Mjg1MjE1","avatar_url":"https://avatars1.githubusercontent.com/u/27285215?v=4","gravatar_id":"","url":"https://api.github.com/users/marcinogo","html_url":"https://github.com/marcinogo","followers_url":"https://api.github.com/users/marcinogo/followers","following_url":"https://api.github.com/users/marcinogo/following{/other_user}","gists_url":"https://api.github.com/users/marcinogo/gists{/gist_id}","starred_url":"https://api.github.com/users/marcinogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcinogo/subscriptions","organizations_url":"https://api.github.com/users/marcinogo/orgs","repos_url":"https://api.github.com/users/marcinogo/repos","events_url":"https://api.github.com/users/marcinogo/events{/privacy}","received_events_url":"https://api.github.com/users/marcinogo/received_events","type":"User","site_admin":false},"html_url":"https://github.com/marcinogo/robot","description":null,"fork":false,"url":"https://api.github.com/repos/marcinogo/robot","forks_url":"https://api.github.com/repos/marcinogo/robot/forks","keys_url":"https://api.github.com/repos/marcinogo/robot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marcinogo/robot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marcinogo/robot/teams","hooks_url":"https://api.github.com/repos/marcinogo/robot/hooks","issue_events_url":"https://api.github.com/repos/marcinogo/robot/issues/events{/number}","events_url":"https://api.github.com/repos/marcinogo/robot/events","assignees_url":"https://api.github.com/repos/marcinogo/robot/assignees{/user}","branches_url":"https://api.github.com/repos/marcinogo/robot/branches{/branch}","tags_url":"https://api.github.com/repos/marcinogo/robot/tags","blobs_url":"https://api.github.com/repos/marcinogo/robot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marcinogo/robot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marcinogo/robot/git/refs{/sha}","trees_url":"https://api.github.com/repos/marcinogo/robot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marcinogo/robot/statuses/{sha}","languages_url":"https://api.github.com/repos/marcinogo/robot/languages","stargazers_url":"https://api.github.com/repos/marcinogo/robot/stargazers","contributors_url":"https://api.github.com/repos/marcinogo/robot/contributors","subscribers_url":"https://api.github.com/repos/marcinogo/robot/subscribers","subscription_url":"https://api.github.com/repos/marcinogo/robot/subscription","commits_url":"https://api.github.com/repos/marcinogo/robot/commits{/sha}","git_commits_url":"https://api.github.com/repos/marcinogo/robot/git/commits{/sha}","comments_url":"https://api.github.com/repos/marcinogo/robot/comments{/number}","issue_comment_url":"https://api.github.com/repos/marcinogo/robot/issues/comments{/number}","contents_url":"https://api.github.com/repos/marcinogo/robot/contents/{+path}","compare_url":"https://api.github.com/repos/marcinogo/robot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marcinogo/robot/merges","archive_url":"https://api.github.com/repos/marcinogo/robot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marcinogo/robot/downloads","issues_url":"https://api.github.com/repos/marcinogo/robot/issues{/number}","pulls_url":"https://api.github.com/repos/marcinogo/robot/pulls{/number}","milestones_url":"https://api.github.com/repos/marcinogo/robot/milestones{/number}","notifications_url":"https://api.github.com/repos/marcinogo/robot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marcinogo/robot/labels{/name}","releases_url":"https://api.github.com/repos/marcinogo/robot/releases{/id}","deployments_url":"https://api.github.com/repos/marcinogo/robot/deployments","created_at":"2019-07-08T13:35:18Z","updated_at":"2019-08-06T06:44:40Z","pushed_at":"2019-08-21T07:29:53Z","git_url":"git://github.com/marcinogo/robot.git","ssh_url":"git@github.com:marcinogo/robot.git","clone_url":"https://github.com/marcinogo/robot.git","svn_url":"https://github.com/marcinogo/robot","homepage":null,"size":531,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":44,"license":null,"forks":0,"open_issues":44,"watchers":2,"default_branch":"master"}},"base":{"label":"marcinogo:develop","ref":"develop","sha":"c2b9a7afeb4fff116c287860230adb34def909ae","user":{"login":"marcinogo","id":27285215,"node_id":"MDQ6VXNlcjI3Mjg1MjE1","avatar_url":"https://avatars1.githubusercontent.com/u/27285215?v=4","gravatar_id":"","url":"https://api.github.com/users/marcinogo","html_url":"https://github.com/marcinogo","followers_url":"https://api.github.com/users/marcinogo/followers","following_url":"https://api.github.com/users/marcinogo/following{/other_user}","gists_url":"https://api.github.com/users/marcinogo/gists{/gist_id}","starred_url":"https://api.github.com/users/marcinogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcinogo/subscriptions","organizations_url":"https://api.github.com/users/marcinogo/orgs","repos_url":"https://api.github.com/users/marcinogo/repos","events_url":"https://api.github.com/users/marcinogo/events{/privacy}","received_events_url":"https://api.github.com/users/marcinogo/received_events","type":"User","site_admin":false},"repo":{"id":195818854,"node_id":"MDEwOlJlcG9zaXRvcnkxOTU4MTg4NTQ=","name":"robot","full_name":"marcinogo/robot","private":false,"owner":{"login":"marcinogo","id":27285215,"node_id":"MDQ6VXNlcjI3Mjg1MjE1","avatar_url":"https://avatars1.githubusercontent.com/u/27285215?v=4","gravatar_id":"","url":"https://api.github.com/users/marcinogo","html_url":"https://github.com/marcinogo","followers_url":"https://api.github.com/users/marcinogo/followers","following_url":"https://api.github.com/users/marcinogo/following{/other_user}","gists_url":"https://api.github.com/users/marcinogo/gists{/gist_id}","starred_url":"https://api.github.com/users/marcinogo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcinogo/subscriptions","organizations_url":"https://api.github.com/users/marcinogo/orgs","repos_url":"https://api.github.com/users/marcinogo/repos","events_url":"https://api.github.com/users/marcinogo/events{/privacy}","received_events_url":"https://api.github.com/users/marcinogo/received_events","type":"User","site_admin":false},"html_url":"https://github.com/marcinogo/robot","description":null,"fork":false,"url":"https://api.github.com/repos/marcinogo/robot","forks_url":"https://api.github.com/repos/marcinogo/robot/forks","keys_url":"https://api.github.com/repos/marcinogo/robot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marcinogo/robot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marcinogo/robot/teams","hooks_url":"https://api.github.com/repos/marcinogo/robot/hooks","issue_events_url":"https://api.github.com/repos/marcinogo/robot/issues/events{/number}","events_url":"https://api.github.com/repos/marcinogo/robot/events","assignees_url":"https://api.github.com/repos/marcinogo/robot/assignees{/user}","branches_url":"https://api.github.com/repos/marcinogo/robot/branches{/branch}","tags_url":"https://api.github.com/repos/marcinogo/robot/tags","blobs_url":"https://api.github.com/repos/marcinogo/robot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marcinogo/robot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marcinogo/robot/git/refs{/sha}","trees_url":"https://api.github.com/repos/marcinogo/robot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marcinogo/robot/statuses/{sha}","languages_url":"https://api.github.com/repos/marcinogo/robot/languages","stargazers_url":"https://api.github.com/repos/marcinogo/robot/stargazers","contributors_url":"https://api.github.com/repos/marcinogo/robot/contributors","subscribers_url":"https://api.github.com/repos/marcinogo/robot/subscribers","subscription_url":"https://api.github.com/repos/marcinogo/robot/subscription","commits_url":"https://api.github.com/repos/marcinogo/robot/commits{/sha}","git_commits_url":"https://api.github.com/repos/marcinogo/robot/git/commits{/sha}","comments_url":"https://api.github.com/repos/marcinogo/robot/comments{/number}","issue_comment_url":"https://api.github.com/repos/marcinogo/robot/issues/comments{/number}","contents_url":"https://api.github.com/repos/marcinogo/robot/contents/{+path}","compare_url":"https://api.github.com/repos/marcinogo/robot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marcinogo/robot/merges","archive_url":"https://api.github.com/repos/marcinogo/robot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marcinogo/robot/downloads","issues_url":"https://api.github.com/repos/marcinogo/robot/issues{/number}","pulls_url":"https://api.github.com/repos/marcinogo/robot/pulls{/number}","milestones_url":"https://api.github.com/repos/marcinogo/robot/milestones{/number}","notifications_url":"https://api.github.com/repos/marcinogo/robot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marcinogo/robot/labels{/name}","releases_url":"https://api.github.com/repos/marcinogo/robot/releases{/id}","deployments_url":"https://api.github.com/repos/marcinogo/robot/deployments","created_at":"2019-07-08T13:35:18Z","updated_at":"2019-08-06T06:44:40Z","pushed_at":"2019-08-21T07:29:53Z","git_url":"git://github.com/marcinogo/robot.git","ssh_url":"git@github.com:marcinogo/robot.git","clone_url":"https://github.com/marcinogo/robot.git","svn_url":"https://github.com/marcinogo/robot","homepage":null,"size":531,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":44,"license":null,"forks":0,"open_issues":44,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marcinogo/robot/pulls/259"},"html":{"href":"https://github.com/marcinogo/robot/pull/259"},"issue":{"href":"https://api.github.com/repos/marcinogo/robot/issues/259"},"comments":{"href":"https://api.github.com/repos/marcinogo/robot/issues/259/comments"},"review_comments":{"href":"https://api.github.com/repos/marcinogo/robot/pulls/259/comments"},"review_comment":{"href":"https://api.github.com/repos/marcinogo/robot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marcinogo/robot/pulls/259/commits"},"statuses":{"href":"https://api.github.com/repos/marcinogo/robot/statuses/db7d4dec3386c6473627b4d2984ebbe4d55e5f2f"}},"author_association":"COLLABORATOR"}}
other: {"actor":{"display_login":"marcinogo"}}