{"action":"created","comment":{"url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments/206712527","pull_request_review_id":142179492,"id":206712527,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjcxMjUyNw==","diff_hunk":"@@ -1415,4 +1415,77 @@ public void getUserByActivationKey_shouldReturnNullIfTokenTimeExpired(){\n \t\tassertNull(userService.getUserByActivationKey(key)); \n \t}\n \t\n+\t@Test\n+\tpublic void changeUserPasswordUsingActivationKey_shouldUpdatePasswordIfActivationKeyIsCorrect() {\n+\t\tUser u = new User();\n+\t\tu.setPerson(new Person());\n+\t\tu.addName(new PersonName(\"Benjamin\", \"A\", \"Wolfe\"));\n+\t\tu.setUsername(\"bwolfe\");\n+\t\tu.getPerson().setGender(\"M\");\n+\t\tUser createdUser = userService.createUser(u, \"Openmr5xy\");\n+\t\tString key = \"h4ph0fpNzQCIPSw8plJI\";\n+\t\tint validTime = 10 * 60 * 1000; //equivalent to 10 minutes for token to be valid\n+\t\tLong tokenTime = System.currentTimeMillis() + validTime;\n+\t\tLoginCredential credentials = dao.getLoginCredential(createdUser);\n+\t\tcredentials.setActivationKey(\n+\t\t    \"b071c88d6d877922e35af2e6a90dd57d37ac61143a03bb986c5f353566f3972a86ce9b2604c31a22dfa467922dcfd54fa7d18b0a7c7648d94ca3d97a88ea2fd0:\"\n+\t\t            + tokenTime);\n+\t\tdao.updateLoginCredential(credentials);\n+\t\t\n+\t\tassertFalse(createdUser.hasPrivilege(PrivilegeConstants.EDIT_USER_PASSWORDS));","path":"api/src/test/java/org/openmrs/api/UserServiceTest.java","position":33,"original_position":33,"commit_id":"0d7068d6191d62326e9bf6c80f33fd4a206ea9ab","original_commit_id":"0d7068d6191d62326e9bf6c80f33fd4a206ea9ab","user":{"login":"wluyima","id":1395907,"node_id":"MDQ6VXNlcjEzOTU5MDc=","avatar_url":"https://avatars0.githubusercontent.com/u/1395907?v=4","gravatar_id":"","url":"https://api.github.com/users/wluyima","html_url":"https://github.com/wluyima","followers_url":"https://api.github.com/users/wluyima/followers","following_url":"https://api.github.com/users/wluyima/following{/other_user}","gists_url":"https://api.github.com/users/wluyima/gists{/gist_id}","starred_url":"https://api.github.com/users/wluyima/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wluyima/subscriptions","organizations_url":"https://api.github.com/users/wluyima/orgs","repos_url":"https://api.github.com/users/wluyima/repos","events_url":"https://api.github.com/users/wluyima/events{/privacy}","received_events_url":"https://api.github.com/users/wluyima/received_events","type":"User","site_admin":false},"body":"What is the use of this? A user changes their own password","created_at":"2018-07-31T23:13:40Z","updated_at":"2018-07-31T23:13:41Z","html_url":"https://github.com/openmrs/openmrs-core/pull/2695#discussion_r206712527","pull_request_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2695","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments/206712527"},"html":{"href":"https://github.com/openmrs/openmrs-core/pull/2695#discussion_r206712527"},"pull_request":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2695"}}},"pull_request":{"url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2695","id":205024181,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MDI0MTgx","html_url":"https://github.com/openmrs/openmrs-core/pull/2695","diff_url":"https://github.com/openmrs/openmrs-core/pull/2695.diff","patch_url":"https://github.com/openmrs/openmrs-core/pull/2695.patch","issue_url":"https://api.github.com/repos/openmrs/openmrs-core/issues/2695","number":2695,"state":"open","locked":false,"title":"Change password provided the actvation key is correct and has not exp…","user":{"login":"fanyui","id":12346597,"node_id":"MDQ6VXNlcjEyMzQ2NTk3","avatar_url":"https://avatars1.githubusercontent.com/u/12346597?v=4","gravatar_id":"","url":"https://api.github.com/users/fanyui","html_url":"https://github.com/fanyui","followers_url":"https://api.github.com/users/fanyui/followers","following_url":"https://api.github.com/users/fanyui/following{/other_user}","gists_url":"https://api.github.com/users/fanyui/gists{/gist_id}","starred_url":"https://api.github.com/users/fanyui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fanyui/subscriptions","organizations_url":"https://api.github.com/users/fanyui/orgs","repos_url":"https://api.github.com/users/fanyui/repos","events_url":"https://api.github.com/users/fanyui/events{/privacy}","received_events_url":"https://api.github.com/users/fanyui/received_events","type":"User","site_admin":false},"body":"\r\n\r\n<!--- Add a pull request title above in this format -->\r\n<!--- real example: 'TRUNK-5111 Replace use of deprecated isVoided' -->\r\n<!--- 'TRUNK-JiraIssueNumber JiraIssueTitle' -->\r\n## Description of what I changed\r\n<!--- Describe your changes in detail -->\r\n<!--- It can simply be your commit message, which you must have -->\r\nChange password provided the actvation key is correct and has not expired Also added test for checking if activation key is not expired or not wrong before updating  password. I also fix a bug in the method getUserByActivationKey. \r\n\r\n## Issue I worked on\r\n<!--- This project only accepts pull requests related to open issues -->\r\n<!--- Want a new feature or change? Discuss it in an issue first -->\r\n<!--- Found a bug? Point us to the issue/or create one so we can reproduce it -->\r\n<!--- Just add the issue number at the end: -->\r\nsee https://issues.openmrs.org/browse/TRUNK-\r\n\r\n## Checklist: I completed these to help reviewers :)\r\n<!--- Put an `x` in the box if you did the task -->\r\n<!--- If you forgot a task please follow the instructions below -->\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  No? -> [read here](https://wiki.openmrs.org/display/docs/Pull+Request+Tips) on how to squash multiple commits into one\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  No? Unsure? -> [configure your IDE](https://wiki.openmrs.org/display/docs/How-To+Setup+And+Use+Your+IDE), format the code and add the changes with `git add . && git commit --amend`\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  No? -> write tests and add them to this commit `git add . && git commit --amend`\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  No? -> execute above command\r\n\r\n- [x ] All new and existing **tests passed**.\r\n\r\n  No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.\r\n\r\n- [ ] My pull request is **based on the latest changes** of the master branch.\r\n\r\n  No? Unsure? -> execute command `git pull --rebase upstream master`\r\n\r\n","created_at":"2018-07-31T07:47:17Z","updated_at":"2018-07-31T23:13:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"743ab628abe473f5d236cde93c7a080470cde556","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2695/commits","review_comments_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2695/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/2695/comments","statuses_url":"https://api.github.com/repos/openmrs/openmrs-core/statuses/0d7068d6191d62326e9bf6c80f33fd4a206ea9ab","head":{"label":"fanyui:savepassword","ref":"savepassword","sha":"0d7068d6191d62326e9bf6c80f33fd4a206ea9ab","user":{"login":"fanyui","id":12346597,"node_id":"MDQ6VXNlcjEyMzQ2NTk3","avatar_url":"https://avatars1.githubusercontent.com/u/12346597?v=4","gravatar_id":"","url":"https://api.github.com/users/fanyui","html_url":"https://github.com/fanyui","followers_url":"https://api.github.com/users/fanyui/followers","following_url":"https://api.github.com/users/fanyui/following{/other_user}","gists_url":"https://api.github.com/users/fanyui/gists{/gist_id}","starred_url":"https://api.github.com/users/fanyui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fanyui/subscriptions","organizations_url":"https://api.github.com/users/fanyui/orgs","repos_url":"https://api.github.com/users/fanyui/repos","events_url":"https://api.github.com/users/fanyui/events{/privacy}","received_events_url":"https://api.github.com/users/fanyui/received_events","type":"User","site_admin":false},"repo":{"id":74731557,"node_id":"MDEwOlJlcG9zaXRvcnk3NDczMTU1Nw==","name":"openmrs-core","full_name":"fanyui/openmrs-core","owner":{"login":"fanyui","id":12346597,"node_id":"MDQ6VXNlcjEyMzQ2NTk3","avatar_url":"https://avatars1.githubusercontent.com/u/12346597?v=4","gravatar_id":"","url":"https://api.github.com/users/fanyui","html_url":"https://github.com/fanyui","followers_url":"https://api.github.com/users/fanyui/followers","following_url":"https://api.github.com/users/fanyui/following{/other_user}","gists_url":"https://api.github.com/users/fanyui/gists{/gist_id}","starred_url":"https://api.github.com/users/fanyui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fanyui/subscriptions","organizations_url":"https://api.github.com/users/fanyui/orgs","repos_url":"https://api.github.com/users/fanyui/repos","events_url":"https://api.github.com/users/fanyui/events{/privacy}","received_events_url":"https://api.github.com/users/fanyui/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fanyui/openmrs-core","description":"OpenMRS API and web application code","fork":true,"url":"https://api.github.com/repos/fanyui/openmrs-core","forks_url":"https://api.github.com/repos/fanyui/openmrs-core/forks","keys_url":"https://api.github.com/repos/fanyui/openmrs-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fanyui/openmrs-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fanyui/openmrs-core/teams","hooks_url":"https://api.github.com/repos/fanyui/openmrs-core/hooks","issue_events_url":"https://api.github.com/repos/fanyui/openmrs-core/issues/events{/number}","events_url":"https://api.github.com/repos/fanyui/openmrs-core/events","assignees_url":"https://api.github.com/repos/fanyui/openmrs-core/assignees{/user}","branches_url":"https://api.github.com/repos/fanyui/openmrs-core/branches{/branch}","tags_url":"https://api.github.com/repos/fanyui/openmrs-core/tags","blobs_url":"https://api.github.com/repos/fanyui/openmrs-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fanyui/openmrs-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fanyui/openmrs-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/fanyui/openmrs-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fanyui/openmrs-core/statuses/{sha}","languages_url":"https://api.github.com/repos/fanyui/openmrs-core/languages","stargazers_url":"https://api.github.com/repos/fanyui/openmrs-core/stargazers","contributors_url":"https://api.github.com/repos/fanyui/openmrs-core/contributors","subscribers_url":"https://api.github.com/repos/fanyui/openmrs-core/subscribers","subscription_url":"https://api.github.com/repos/fanyui/openmrs-core/subscription","commits_url":"https://api.github.com/repos/fanyui/openmrs-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/fanyui/openmrs-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/fanyui/openmrs-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/fanyui/openmrs-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/fanyui/openmrs-core/contents/{+path}","compare_url":"https://api.github.com/repos/fanyui/openmrs-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fanyui/openmrs-core/merges","archive_url":"https://api.github.com/repos/fanyui/openmrs-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fanyui/openmrs-core/downloads","issues_url":"https://api.github.com/repos/fanyui/openmrs-core/issues{/number}","pulls_url":"https://api.github.com/repos/fanyui/openmrs-core/pulls{/number}","milestones_url":"https://api.github.com/repos/fanyui/openmrs-core/milestones{/number}","notifications_url":"https://api.github.com/repos/fanyui/openmrs-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fanyui/openmrs-core/labels{/name}","releases_url":"https://api.github.com/repos/fanyui/openmrs-core/releases{/id}","deployments_url":"https://api.github.com/repos/fanyui/openmrs-core/deployments","created_at":"2016-11-25T06:27:12Z","updated_at":"2018-05-14T04:47:43Z","pushed_at":"2018-07-31T07:40:08Z","git_url":"git://github.com/fanyui/openmrs-core.git","ssh_url":"git@github.com:fanyui/openmrs-core.git","clone_url":"https://github.com/fanyui/openmrs-core.git","svn_url":"https://github.com/fanyui/openmrs-core","homepage":"http://openmrs.org","size":227678,"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":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openmrs:passwordreset","ref":"passwordreset","sha":"7b5bd2bf223578c556df6844dfba9787f6d93b5e","user":{"login":"openmrs","id":860776,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg2MDc3Ng==","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,"node_id":"MDEwOlJlcG9zaXRvcnk1MTg3OTc2","name":"openmrs-core","full_name":"openmrs/openmrs-core","owner":{"login":"openmrs","id":860776,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg2MDc3Ng==","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-07-30T16:10:14Z","pushed_at":"2018-07-31T20:59:38Z","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":227961,"stargazers_count":668,"watchers_count":668,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2141,"mirror_url":null,"archived":false,"open_issues_count":11,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2141,"open_issues":11,"watchers":668,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2695"},"html":{"href":"https://github.com/openmrs/openmrs-core/pull/2695"},"issue":{"href":"https://api.github.com/repos/openmrs/openmrs-core/issues/2695"},"comments":{"href":"https://api.github.com/repos/openmrs/openmrs-core/issues/2695/comments"},"review_comments":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2695/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/2695/commits"},"statuses":{"href":"https://api.github.com/repos/openmrs/openmrs-core/statuses/0d7068d6191d62326e9bf6c80f33fd4a206ea9ab"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"wluyima"}}