{"action":"created","comment":{"url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments/167444970","pull_request_review_id":95665514,"id":167444970,"diff_hunk":"@@ -173,4 +179,146 @@ public void saveProgram_shouldFailIfProgramWorkFlowStateTerminalIsNull() {\n \t\t\n \t\tpws.saveProgram(program);\n \t}\n+\t\n+\t@Test\n+\tpublic void savePatientProgram_shouldFailForNullPatient() {\n+\t\t\n+\t\texception.expect(APIException.class);\n+\t\texception.expectMessage(\"PatientProgram requires a Patient and a Program\");\n+\t\t\n+\t\tPatientProgram patientProgram = new PatientProgram(1);\n+\t\tpatientProgram.setProgram(new Program(1));\n+\t\t\n+\t\tpws.savePatientProgram(patientProgram);\n+\t}\n+\t\n+\t@Test\n+\tpublic void savePatientProgram_shouldFailForNullProgram() {\n+\t\t\n+\t\texception.expect(APIException.class);\n+\t\texception.expectMessage(\"PatientProgram requires a Patient and a Program\");\n+\t\t\n+\t\tPatientProgram patientProgram = new PatientProgram(1);\n+\t\tpatientProgram.setPatient(new Patient(1));\n+\t\t\n+\t\tpws.savePatientProgram(patientProgram);\n+\t}\n+\t\n+\t@Test\n+\tpublic void purgePatientProgram_shouldFailForNotEmptyStatesAndTrueCascade() {\n+\t\t\n+\t\texception.expect(APIException.class);\n+\t\texception.expectMessage(\"Cascade purging of PatientPrograms is not implemented yet\");\n+\t\t\n+\t\tPatientProgram patientProgram = new PatientProgram(1);\n+\t\t\n+\t\tSet<PatientState> patientStates = new Set<PatientState>() {","path":"api/src/test/java/org/openmrs/api/ProgramWorkflowServiceUnitTest.java","position":null,"original_position":58,"commit_id":"fd8c0056d25f3ac27d29e160881b072561b7d168","original_commit_id":"5164eec9a8c5fc34f70c9f62b7c7d959332b459b","user":{"login":"dilekamadushan","id":17608777,"avatar_url":"https://avatars0.githubusercontent.com/u/17608777?v=4","gravatar_id":"","url":"https://api.github.com/users/dilekamadushan","html_url":"https://github.com/dilekamadushan","followers_url":"https://api.github.com/users/dilekamadushan/followers","following_url":"https://api.github.com/users/dilekamadushan/following{/other_user}","gists_url":"https://api.github.com/users/dilekamadushan/gists{/gist_id}","starred_url":"https://api.github.com/users/dilekamadushan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilekamadushan/subscriptions","organizations_url":"https://api.github.com/users/dilekamadushan/orgs","repos_url":"https://api.github.com/users/dilekamadushan/repos","events_url":"https://api.github.com/users/dilekamadushan/events{/privacy}","received_events_url":"https://api.github.com/users/dilekamadushan/received_events","type":"User","site_admin":false},"body":"@teleivo This is a much easier way. Thanks","created_at":"2018-02-11T18:53:53Z","updated_at":"2018-02-11T18:53:53Z","html_url":"https://github.com/openmrs/openmrs-core/pull/2565#discussion_r167444970","pull_request_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2565","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/comments/167444970"},"html":{"href":"https://github.com/openmrs/openmrs-core/pull/2565#discussion_r167444970"},"pull_request":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2565"}},"in_reply_to_id":167441445},"pull_request":{"url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2565","id":166242998,"html_url":"https://github.com/openmrs/openmrs-core/pull/2565","diff_url":"https://github.com/openmrs/openmrs-core/pull/2565.diff","patch_url":"https://github.com/openmrs/openmrs-core/pull/2565.patch","issue_url":"https://api.github.com/repos/openmrs/openmrs-core/issues/2565","number":2565,"state":"open","locked":false,"title":"TRUNK-5068 Add tests to ProgramWorkflowService","user":{"login":"dilekamadushan","id":17608777,"avatar_url":"https://avatars0.githubusercontent.com/u/17608777?v=4","gravatar_id":"","url":"https://api.github.com/users/dilekamadushan","html_url":"https://github.com/dilekamadushan","followers_url":"https://api.github.com/users/dilekamadushan/followers","following_url":"https://api.github.com/users/dilekamadushan/following{/other_user}","gists_url":"https://api.github.com/users/dilekamadushan/gists{/gist_id}","starred_url":"https://api.github.com/users/dilekamadushan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilekamadushan/subscriptions","organizations_url":"https://api.github.com/users/dilekamadushan/orgs","repos_url":"https://api.github.com/users/dilekamadushan/repos","events_url":"https://api.github.com/users/dilekamadushan/events{/privacy}","received_events_url":"https://api.github.com/users/dilekamadushan/received_events","type":"User","site_admin":false},"body":"https://issues.openmrs.org/browse/TRUNK-5068\r\n\r\n## Description of what I changed\r\nAdded tests to ProgramWorkflowService\r\n\r\n## Checklist: I completed these to help reviewers :)\r\n\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- [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- [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- [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- [x] All new and existing **tests passed**.\r\n\r\n- [x] My pull request is **based on the latest changes** of the master branch.","created_at":"2018-01-31T12:13:09Z","updated_at":"2018-02-11T18:53:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"40f784065b8ee4f2cc6f0a08219184079b6ec815","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2565/commits","review_comments_url":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2565/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/2565/comments","statuses_url":"https://api.github.com/repos/openmrs/openmrs-core/statuses/fd8c0056d25f3ac27d29e160881b072561b7d168","head":{"label":"dilekamadushan:TRUNK-5068","ref":"TRUNK-5068","sha":"fd8c0056d25f3ac27d29e160881b072561b7d168","user":{"login":"dilekamadushan","id":17608777,"avatar_url":"https://avatars0.githubusercontent.com/u/17608777?v=4","gravatar_id":"","url":"https://api.github.com/users/dilekamadushan","html_url":"https://github.com/dilekamadushan","followers_url":"https://api.github.com/users/dilekamadushan/followers","following_url":"https://api.github.com/users/dilekamadushan/following{/other_user}","gists_url":"https://api.github.com/users/dilekamadushan/gists{/gist_id}","starred_url":"https://api.github.com/users/dilekamadushan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilekamadushan/subscriptions","organizations_url":"https://api.github.com/users/dilekamadushan/orgs","repos_url":"https://api.github.com/users/dilekamadushan/repos","events_url":"https://api.github.com/users/dilekamadushan/events{/privacy}","received_events_url":"https://api.github.com/users/dilekamadushan/received_events","type":"User","site_admin":false},"repo":{"id":111167425,"name":"openmrs-core","full_name":"dilekamadushan/openmrs-core","owner":{"login":"dilekamadushan","id":17608777,"avatar_url":"https://avatars0.githubusercontent.com/u/17608777?v=4","gravatar_id":"","url":"https://api.github.com/users/dilekamadushan","html_url":"https://github.com/dilekamadushan","followers_url":"https://api.github.com/users/dilekamadushan/followers","following_url":"https://api.github.com/users/dilekamadushan/following{/other_user}","gists_url":"https://api.github.com/users/dilekamadushan/gists{/gist_id}","starred_url":"https://api.github.com/users/dilekamadushan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilekamadushan/subscriptions","organizations_url":"https://api.github.com/users/dilekamadushan/orgs","repos_url":"https://api.github.com/users/dilekamadushan/repos","events_url":"https://api.github.com/users/dilekamadushan/events{/privacy}","received_events_url":"https://api.github.com/users/dilekamadushan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dilekamadushan/openmrs-core","description":"OpenMRS API and web application code","fork":true,"url":"https://api.github.com/repos/dilekamadushan/openmrs-core","forks_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/forks","keys_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/teams","hooks_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/hooks","issue_events_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/issues/events{/number}","events_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/events","assignees_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/assignees{/user}","branches_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/branches{/branch}","tags_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/tags","blobs_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/statuses/{sha}","languages_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/languages","stargazers_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/stargazers","contributors_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/contributors","subscribers_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/subscribers","subscription_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/subscription","commits_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/contents/{+path}","compare_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/merges","archive_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/downloads","issues_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/issues{/number}","pulls_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/pulls{/number}","milestones_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/milestones{/number}","notifications_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/labels{/name}","releases_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/releases{/id}","deployments_url":"https://api.github.com/repos/dilekamadushan/openmrs-core/deployments","created_at":"2017-11-18T01:45:20Z","updated_at":"2017-11-18T01:45:29Z","pushed_at":"2018-02-11T18:50:45Z","git_url":"git://github.com/dilekamadushan/openmrs-core.git","ssh_url":"git@github.com:dilekamadushan/openmrs-core.git","clone_url":"https://github.com/dilekamadushan/openmrs-core.git","svn_url":"https://github.com/dilekamadushan/openmrs-core","homepage":"http://openmrs.org","size":227149,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openmrs:master","ref":"master","sha":"e6b7f32033b9069941e0abba8391528bca0503a7","user":{"login":"openmrs","id":860776,"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,"name":"openmrs-core","full_name":"openmrs/openmrs-core","owner":{"login":"openmrs","id":860776,"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-02-09T13:03:34Z","pushed_at":"2018-02-11T18:50:47Z","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":227201,"stargazers_count":615,"watchers_count":615,"language":"Java","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2022,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2022,"open_issues":18,"watchers":615,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2565"},"html":{"href":"https://github.com/openmrs/openmrs-core/pull/2565"},"issue":{"href":"https://api.github.com/repos/openmrs/openmrs-core/issues/2565"},"comments":{"href":"https://api.github.com/repos/openmrs/openmrs-core/issues/2565/comments"},"review_comments":{"href":"https://api.github.com/repos/openmrs/openmrs-core/pulls/2565/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/2565/commits"},"statuses":{"href":"https://api.github.com/repos/openmrs/openmrs-core/statuses/fd8c0056d25f3ac27d29e160881b072561b7d168"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dilekamadushan"}}