{"action":"created","comment":{"url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls/comments/72887233","id":72887233,"diff_hunk":"@@ -0,0 +1,52 @@\n+package com.alextim.bookshelf.service.impl;\n+\n+import com.alextim.bookshelf.repository.UserRepository;\n+import com.alextim.entity.User;\n+import org.junit.Test;\n+import org.junit.runner.RunWith;\n+import org.mockito.InjectMocks;\n+import org.mockito.Mock;\n+import static org.mockito.Mockito.*;\n+import org.mockito.runners.MockitoJUnitRunner;\n+\n+/**\n+ * Created by admin on 30.07.2016.\n+ */\n+\n+@RunWith(MockitoJUnitRunner.class)\n+public class UserServiceImplTest {\n+    private static final String LOGIN = \"stimofeev\";\n+    private static final String PASSWORD = \"111\";\n+    private static final String NEW_PASSWORD = \"222\";\n+\n+    @Mock\n+    private User user;\n+    @Mock\n+    private UserRepository userRepository;\n+    @InjectMocks\n+    private UserServiceImpl userService = new UserServiceImpl();\n+\n+    @Test\n+    public void shouldChangUserPassword(){\n+        when(userRepository.findByLogin(LOGIN)).thenReturn(user);\n+        when(user.getPassword()).thenReturn(PASSWORD);\n+\n+        userService.changePassword(LOGIN, PASSWORD, NEW_PASSWORD);\n+\n+        verify(user).setPassword(NEW_PASSWORD);\n+        verify(userRepository).saveAndFlush(user);\n+    }\n+\n+    @Test(expected = IllegalArgumentException.class)\n+    public void shouldThrowIllegalArgumentExceptionIfPasswordNull(){\n+        userService.changePassword(LOGIN, null, null);\n+    }\n+\n+    @Test(expected = IllegalStateException.class)\n+    public void shouldThrowIllegalStateException(){","path":"disk-archive-data/src/test/java/com/alextim/bookshelf/service/impl/UserServiceImplTest.java","position":46,"original_position":46,"commit_id":"fac8f925e8922e9bd0109c19bdfa96051a26b9c8","original_commit_id":"fac8f925e8922e9bd0109c19bdfa96051a26b9c8","user":{"login":"aleksey-timofeev","id":1856477,"avatar_url":"https://avatars.githubusercontent.com/u/1856477?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksey-timofeev","html_url":"https://github.com/aleksey-timofeev","followers_url":"https://api.github.com/users/aleksey-timofeev/followers","following_url":"https://api.github.com/users/aleksey-timofeev/following{/other_user}","gists_url":"https://api.github.com/users/aleksey-timofeev/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksey-timofeev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksey-timofeev/subscriptions","organizations_url":"https://api.github.com/users/aleksey-timofeev/orgs","repos_url":"https://api.github.com/users/aleksey-timofeev/repos","events_url":"https://api.github.com/users/aleksey-timofeev/events{/privacy}","received_events_url":"https://api.github.com/users/aleksey-timofeev/received_events","type":"User","site_admin":false},"body":"Change test name to more appropriate name","created_at":"2016-07-30T13:17:24Z","updated_at":"2016-07-30T13:17:24Z","html_url":"https://github.com/aleksey-timofeev/disk-archive/pull/5#discussion_r72887233","pull_request_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls/comments/72887233"},"html":{"href":"https://github.com/aleksey-timofeev/disk-archive/pull/5#discussion_r72887233"},"pull_request":{"href":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls/5","id":79457025,"html_url":"https://github.com/aleksey-timofeev/disk-archive/pull/5","diff_url":"https://github.com/aleksey-timofeev/disk-archive/pull/5.diff","patch_url":"https://github.com/aleksey-timofeev/disk-archive/pull/5.patch","issue_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/issues/5","number":5,"state":"open","locked":false,"title":"Book 7","user":{"login":"sergtm1","id":19514038,"avatar_url":"https://avatars.githubusercontent.com/u/19514038?v=3","gravatar_id":"","url":"https://api.github.com/users/sergtm1","html_url":"https://github.com/sergtm1","followers_url":"https://api.github.com/users/sergtm1/followers","following_url":"https://api.github.com/users/sergtm1/following{/other_user}","gists_url":"https://api.github.com/users/sergtm1/gists{/gist_id}","starred_url":"https://api.github.com/users/sergtm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergtm1/subscriptions","organizations_url":"https://api.github.com/users/sergtm1/orgs","repos_url":"https://api.github.com/users/sergtm1/repos","events_url":"https://api.github.com/users/sergtm1/events{/privacy}","received_events_url":"https://api.github.com/users/sergtm1/received_events","type":"User","site_admin":false},"body":"implementation of user services and tests for them","created_at":"2016-07-30T13:08:48Z","updated_at":"2016-07-30T13:17:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls/5/commits","review_comments_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls/5/comments","review_comment_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/issues/5/comments","statuses_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/statuses/fac8f925e8922e9bd0109c19bdfa96051a26b9c8","head":{"label":"aleksey-timofeev:BOOK-7","ref":"BOOK-7","sha":"fac8f925e8922e9bd0109c19bdfa96051a26b9c8","user":{"login":"aleksey-timofeev","id":1856477,"avatar_url":"https://avatars.githubusercontent.com/u/1856477?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksey-timofeev","html_url":"https://github.com/aleksey-timofeev","followers_url":"https://api.github.com/users/aleksey-timofeev/followers","following_url":"https://api.github.com/users/aleksey-timofeev/following{/other_user}","gists_url":"https://api.github.com/users/aleksey-timofeev/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksey-timofeev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksey-timofeev/subscriptions","organizations_url":"https://api.github.com/users/aleksey-timofeev/orgs","repos_url":"https://api.github.com/users/aleksey-timofeev/repos","events_url":"https://api.github.com/users/aleksey-timofeev/events{/privacy}","received_events_url":"https://api.github.com/users/aleksey-timofeev/received_events","type":"User","site_admin":false},"repo":{"id":4683940,"name":"disk-archive","full_name":"aleksey-timofeev/disk-archive","owner":{"login":"aleksey-timofeev","id":1856477,"avatar_url":"https://avatars.githubusercontent.com/u/1856477?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksey-timofeev","html_url":"https://github.com/aleksey-timofeev","followers_url":"https://api.github.com/users/aleksey-timofeev/followers","following_url":"https://api.github.com/users/aleksey-timofeev/following{/other_user}","gists_url":"https://api.github.com/users/aleksey-timofeev/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksey-timofeev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksey-timofeev/subscriptions","organizations_url":"https://api.github.com/users/aleksey-timofeev/orgs","repos_url":"https://api.github.com/users/aleksey-timofeev/repos","events_url":"https://api.github.com/users/aleksey-timofeev/events{/privacy}","received_events_url":"https://api.github.com/users/aleksey-timofeev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aleksey-timofeev/disk-archive","description":"DVD disk archive project","fork":false,"url":"https://api.github.com/repos/aleksey-timofeev/disk-archive","forks_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/forks","keys_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/teams","hooks_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/hooks","issue_events_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/issues/events{/number}","events_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/events","assignees_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/assignees{/user}","branches_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/branches{/branch}","tags_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/tags","blobs_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/git/refs{/sha}","trees_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/statuses/{sha}","languages_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/languages","stargazers_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/stargazers","contributors_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/contributors","subscribers_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/subscribers","subscription_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/subscription","commits_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/commits{/sha}","git_commits_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/git/commits{/sha}","comments_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/comments{/number}","issue_comment_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/issues/comments{/number}","contents_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/contents/{+path}","compare_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/merges","archive_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/downloads","issues_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/issues{/number}","pulls_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls{/number}","milestones_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/milestones{/number}","notifications_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/labels{/name}","releases_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/releases{/id}","deployments_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/deployments","created_at":"2012-06-16T10:48:36Z","updated_at":"2016-04-28T20:05:59Z","pushed_at":"2016-07-30T13:08:48Z","git_url":"git://github.com/aleksey-timofeev/disk-archive.git","ssh_url":"git@github.com:aleksey-timofeev/disk-archive.git","clone_url":"https://github.com/aleksey-timofeev/disk-archive.git","svn_url":"https://github.com/aleksey-timofeev/disk-archive","homepage":null,"size":25524,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"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":"aleksey-timofeev:master","ref":"master","sha":"8bf3729af94b06b1968204645511507782be942c","user":{"login":"aleksey-timofeev","id":1856477,"avatar_url":"https://avatars.githubusercontent.com/u/1856477?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksey-timofeev","html_url":"https://github.com/aleksey-timofeev","followers_url":"https://api.github.com/users/aleksey-timofeev/followers","following_url":"https://api.github.com/users/aleksey-timofeev/following{/other_user}","gists_url":"https://api.github.com/users/aleksey-timofeev/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksey-timofeev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksey-timofeev/subscriptions","organizations_url":"https://api.github.com/users/aleksey-timofeev/orgs","repos_url":"https://api.github.com/users/aleksey-timofeev/repos","events_url":"https://api.github.com/users/aleksey-timofeev/events{/privacy}","received_events_url":"https://api.github.com/users/aleksey-timofeev/received_events","type":"User","site_admin":false},"repo":{"id":4683940,"name":"disk-archive","full_name":"aleksey-timofeev/disk-archive","owner":{"login":"aleksey-timofeev","id":1856477,"avatar_url":"https://avatars.githubusercontent.com/u/1856477?v=3","gravatar_id":"","url":"https://api.github.com/users/aleksey-timofeev","html_url":"https://github.com/aleksey-timofeev","followers_url":"https://api.github.com/users/aleksey-timofeev/followers","following_url":"https://api.github.com/users/aleksey-timofeev/following{/other_user}","gists_url":"https://api.github.com/users/aleksey-timofeev/gists{/gist_id}","starred_url":"https://api.github.com/users/aleksey-timofeev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleksey-timofeev/subscriptions","organizations_url":"https://api.github.com/users/aleksey-timofeev/orgs","repos_url":"https://api.github.com/users/aleksey-timofeev/repos","events_url":"https://api.github.com/users/aleksey-timofeev/events{/privacy}","received_events_url":"https://api.github.com/users/aleksey-timofeev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aleksey-timofeev/disk-archive","description":"DVD disk archive project","fork":false,"url":"https://api.github.com/repos/aleksey-timofeev/disk-archive","forks_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/forks","keys_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/teams","hooks_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/hooks","issue_events_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/issues/events{/number}","events_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/events","assignees_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/assignees{/user}","branches_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/branches{/branch}","tags_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/tags","blobs_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/git/refs{/sha}","trees_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/statuses/{sha}","languages_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/languages","stargazers_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/stargazers","contributors_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/contributors","subscribers_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/subscribers","subscription_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/subscription","commits_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/commits{/sha}","git_commits_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/git/commits{/sha}","comments_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/comments{/number}","issue_comment_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/issues/comments{/number}","contents_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/contents/{+path}","compare_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/merges","archive_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/downloads","issues_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/issues{/number}","pulls_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls{/number}","milestones_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/milestones{/number}","notifications_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/labels{/name}","releases_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/releases{/id}","deployments_url":"https://api.github.com/repos/aleksey-timofeev/disk-archive/deployments","created_at":"2012-06-16T10:48:36Z","updated_at":"2016-04-28T20:05:59Z","pushed_at":"2016-07-30T13:08:48Z","git_url":"git://github.com/aleksey-timofeev/disk-archive.git","ssh_url":"git@github.com:aleksey-timofeev/disk-archive.git","clone_url":"https://github.com/aleksey-timofeev/disk-archive.git","svn_url":"https://github.com/aleksey-timofeev/disk-archive","homepage":null,"size":25524,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"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/aleksey-timofeev/disk-archive/pulls/5"},"html":{"href":"https://github.com/aleksey-timofeev/disk-archive/pull/5"},"issue":{"href":"https://api.github.com/repos/aleksey-timofeev/disk-archive/issues/5"},"comments":{"href":"https://api.github.com/repos/aleksey-timofeev/disk-archive/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aleksey-timofeev/disk-archive/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/aleksey-timofeev/disk-archive/statuses/fac8f925e8922e9bd0109c19bdfa96051a26b9c8"}}}}
{"actor":{"display_login":"aleksey-timofeev"}}