{"action":"created","comment":{"url":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls/comments/180378158","pull_request_review_id":110785726,"id":180378158,"diff_hunk":"@@ -114,7 +114,7 @@ public void validSearch() throws Exception {\n         // Check that we have the expected test data set size, this is to ensure","path":"src/test/java/uk/gov/hmcts/ccd/endpoint/ui/QueryEndpointIT.java","position":1,"original_position":1,"commit_id":"678ca4222ff7c4f0ebad83da290fa6c694c2c5d2","original_commit_id":"8f23a2cab12f6b0f9016836e99a202658d6bfcd0","user":{"login":"vlaurin","id":1534822,"avatar_url":"https://avatars0.githubusercontent.com/u/1534822?v=4","gravatar_id":"","url":"https://api.github.com/users/vlaurin","html_url":"https://github.com/vlaurin","followers_url":"https://api.github.com/users/vlaurin/followers","following_url":"https://api.github.com/users/vlaurin/following{/other_user}","gists_url":"https://api.github.com/users/vlaurin/gists{/gist_id}","starred_url":"https://api.github.com/users/vlaurin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlaurin/subscriptions","organizations_url":"https://api.github.com/users/vlaurin/orgs","repos_url":"https://api.github.com/users/vlaurin/repos","events_url":"https://api.github.com/users/vlaurin/events{/privacy}","received_events_url":"https://api.github.com/users/vlaurin/received_events","type":"User","site_admin":false},"body":"I would as well, but I cannot think of a decent way of doing it because of the Criteria API. One way would be to create a rather complex hierarchy of mocks; the other way would be to use a real persistence context, build query, unwrap them into the JPA provider specific type and then output them as SQL and test the string. I'm not sold on either of those :s","created_at":"2018-04-10T10:58:11Z","updated_at":"2018-04-10T10:58:12Z","html_url":"https://github.com/hmcts/ccd-data-store-api/pull/8#discussion_r180378158","pull_request_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls/8","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls/comments/180378158"},"html":{"href":"https://github.com/hmcts/ccd-data-store-api/pull/8#discussion_r180378158"},"pull_request":{"href":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls/8"}},"in_reply_to_id":180102532},"pull_request":{"url":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls/8","id":179989079,"html_url":"https://github.com/hmcts/ccd-data-store-api/pull/8","diff_url":"https://github.com/hmcts/ccd-data-store-api/pull/8.diff","patch_url":"https://github.com/hmcts/ccd-data-store-api/pull/8.patch","issue_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/issues/8","number":8,"state":"open","locked":false,"title":"RDM-1448: Enforce user access at DB level","user":{"login":"vlaurin","id":1534822,"avatar_url":"https://avatars0.githubusercontent.com/u/1534822?v=4","gravatar_id":"","url":"https://api.github.com/users/vlaurin","html_url":"https://github.com/vlaurin","followers_url":"https://api.github.com/users/vlaurin/followers","following_url":"https://api.github.com/users/vlaurin/following{/other_user}","gists_url":"https://api.github.com/users/vlaurin/gists{/gist_id}","starred_url":"https://api.github.com/users/vlaurin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlaurin/subscriptions","organizations_url":"https://api.github.com/users/vlaurin/orgs","repos_url":"https://api.github.com/users/vlaurin/repos","events_url":"https://api.github.com/users/vlaurin/events{/privacy}","received_events_url":"https://api.github.com/users/vlaurin/received_events","type":"User","site_admin":false},"body":"### JIRA link (if applicable) ###\r\n\r\nhttps://tools.hmcts.net/jira/browse/RDM-1448\r\n\r\n### Change description ###\r\n\r\nEnforce user access constraints as part of the SQL queries. This allows pagination on search to stay accurate when cases are filtered out by this constraint.\r\n\r\n**Does this PR introduce a breaking change?** (check one with \"x\")\r\n\r\n```\r\n[ ] Yes\r\n[x] No\r\n```\r\n","created_at":"2018-04-06T15:58:33Z","updated_at":"2018-04-10T10:58:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00fa6a96056c96718d27a66e8d4da9be6b3a0e8e","assignee":null,"assignees":[],"requested_reviewers":[{"login":"ngul","id":7276204,"avatar_url":"https://avatars2.githubusercontent.com/u/7276204?v=4","gravatar_id":"","url":"https://api.github.com/users/ngul","html_url":"https://github.com/ngul","followers_url":"https://api.github.com/users/ngul/followers","following_url":"https://api.github.com/users/ngul/following{/other_user}","gists_url":"https://api.github.com/users/ngul/gists{/gist_id}","starred_url":"https://api.github.com/users/ngul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngul/subscriptions","organizations_url":"https://api.github.com/users/ngul/orgs","repos_url":"https://api.github.com/users/ngul/repos","events_url":"https://api.github.com/users/ngul/events{/privacy}","received_events_url":"https://api.github.com/users/ngul/received_events","type":"User","site_admin":false},{"login":"hemantt","id":13850721,"avatar_url":"https://avatars0.githubusercontent.com/u/13850721?v=4","gravatar_id":"","url":"https://api.github.com/users/hemantt","html_url":"https://github.com/hemantt","followers_url":"https://api.github.com/users/hemantt/followers","following_url":"https://api.github.com/users/hemantt/following{/other_user}","gists_url":"https://api.github.com/users/hemantt/gists{/gist_id}","starred_url":"https://api.github.com/users/hemantt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hemantt/subscriptions","organizations_url":"https://api.github.com/users/hemantt/orgs","repos_url":"https://api.github.com/users/hemantt/repos","events_url":"https://api.github.com/users/hemantt/events{/privacy}","received_events_url":"https://api.github.com/users/hemantt/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":868149331,"url":"https://api.github.com/repos/hmcts/ccd-data-store-api/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls/8/commits","review_comments_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls/8/comments","review_comment_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/issues/8/comments","statuses_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/statuses/678ca4222ff7c4f0ebad83da290fa6c694c2c5d2","head":{"label":"hmcts:RDM-1448","ref":"RDM-1448","sha":"678ca4222ff7c4f0ebad83da290fa6c694c2c5d2","user":{"login":"hmcts","id":22817111,"avatar_url":"https://avatars1.githubusercontent.com/u/22817111?v=4","gravatar_id":"","url":"https://api.github.com/users/hmcts","html_url":"https://github.com/hmcts","followers_url":"https://api.github.com/users/hmcts/followers","following_url":"https://api.github.com/users/hmcts/following{/other_user}","gists_url":"https://api.github.com/users/hmcts/gists{/gist_id}","starred_url":"https://api.github.com/users/hmcts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmcts/subscriptions","organizations_url":"https://api.github.com/users/hmcts/orgs","repos_url":"https://api.github.com/users/hmcts/repos","events_url":"https://api.github.com/users/hmcts/events{/privacy}","received_events_url":"https://api.github.com/users/hmcts/received_events","type":"Organization","site_admin":false},"repo":{"id":125355348,"name":"ccd-data-store-api","full_name":"hmcts/ccd-data-store-api","owner":{"login":"hmcts","id":22817111,"avatar_url":"https://avatars1.githubusercontent.com/u/22817111?v=4","gravatar_id":"","url":"https://api.github.com/users/hmcts","html_url":"https://github.com/hmcts","followers_url":"https://api.github.com/users/hmcts/followers","following_url":"https://api.github.com/users/hmcts/following{/other_user}","gists_url":"https://api.github.com/users/hmcts/gists{/gist_id}","starred_url":"https://api.github.com/users/hmcts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmcts/subscriptions","organizations_url":"https://api.github.com/users/hmcts/orgs","repos_url":"https://api.github.com/users/hmcts/repos","events_url":"https://api.github.com/users/hmcts/events{/privacy}","received_events_url":"https://api.github.com/users/hmcts/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hmcts/ccd-data-store-api","description":" Store/search cases and provide workbaskets","fork":false,"url":"https://api.github.com/repos/hmcts/ccd-data-store-api","forks_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/forks","keys_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/teams","hooks_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/hooks","issue_events_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/issues/events{/number}","events_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/events","assignees_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/assignees{/user}","branches_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/branches{/branch}","tags_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/tags","blobs_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/statuses/{sha}","languages_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/languages","stargazers_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/stargazers","contributors_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/contributors","subscribers_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/subscribers","subscription_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/subscription","commits_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/contents/{+path}","compare_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/merges","archive_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/downloads","issues_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/issues{/number}","pulls_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls{/number}","milestones_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/milestones{/number}","notifications_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/labels{/name}","releases_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/releases{/id}","deployments_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/deployments","created_at":"2018-03-15T11:10:14Z","updated_at":"2018-04-09T09:44:58Z","pushed_at":"2018-04-10T09:11:43Z","git_url":"git://github.com/hmcts/ccd-data-store-api.git","ssh_url":"git@github.com:hmcts/ccd-data-store-api.git","clone_url":"https://github.com/hmcts/ccd-data-store-api.git","svn_url":"https://github.com/hmcts/ccd-data-store-api","homepage":"","size":799,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"hmcts:master","ref":"master","sha":"7c837a1e99a93ccdba2f0db751a6d677716eeac1","user":{"login":"hmcts","id":22817111,"avatar_url":"https://avatars1.githubusercontent.com/u/22817111?v=4","gravatar_id":"","url":"https://api.github.com/users/hmcts","html_url":"https://github.com/hmcts","followers_url":"https://api.github.com/users/hmcts/followers","following_url":"https://api.github.com/users/hmcts/following{/other_user}","gists_url":"https://api.github.com/users/hmcts/gists{/gist_id}","starred_url":"https://api.github.com/users/hmcts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmcts/subscriptions","organizations_url":"https://api.github.com/users/hmcts/orgs","repos_url":"https://api.github.com/users/hmcts/repos","events_url":"https://api.github.com/users/hmcts/events{/privacy}","received_events_url":"https://api.github.com/users/hmcts/received_events","type":"Organization","site_admin":false},"repo":{"id":125355348,"name":"ccd-data-store-api","full_name":"hmcts/ccd-data-store-api","owner":{"login":"hmcts","id":22817111,"avatar_url":"https://avatars1.githubusercontent.com/u/22817111?v=4","gravatar_id":"","url":"https://api.github.com/users/hmcts","html_url":"https://github.com/hmcts","followers_url":"https://api.github.com/users/hmcts/followers","following_url":"https://api.github.com/users/hmcts/following{/other_user}","gists_url":"https://api.github.com/users/hmcts/gists{/gist_id}","starred_url":"https://api.github.com/users/hmcts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmcts/subscriptions","organizations_url":"https://api.github.com/users/hmcts/orgs","repos_url":"https://api.github.com/users/hmcts/repos","events_url":"https://api.github.com/users/hmcts/events{/privacy}","received_events_url":"https://api.github.com/users/hmcts/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hmcts/ccd-data-store-api","description":" Store/search cases and provide workbaskets","fork":false,"url":"https://api.github.com/repos/hmcts/ccd-data-store-api","forks_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/forks","keys_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/teams","hooks_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/hooks","issue_events_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/issues/events{/number}","events_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/events","assignees_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/assignees{/user}","branches_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/branches{/branch}","tags_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/tags","blobs_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/statuses/{sha}","languages_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/languages","stargazers_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/stargazers","contributors_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/contributors","subscribers_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/subscribers","subscription_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/subscription","commits_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/contents/{+path}","compare_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/merges","archive_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/downloads","issues_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/issues{/number}","pulls_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls{/number}","milestones_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/milestones{/number}","notifications_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/labels{/name}","releases_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/releases{/id}","deployments_url":"https://api.github.com/repos/hmcts/ccd-data-store-api/deployments","created_at":"2018-03-15T11:10:14Z","updated_at":"2018-04-09T09:44:58Z","pushed_at":"2018-04-10T09:11:43Z","git_url":"git://github.com/hmcts/ccd-data-store-api.git","ssh_url":"git@github.com:hmcts/ccd-data-store-api.git","clone_url":"https://github.com/hmcts/ccd-data-store-api.git","svn_url":"https://github.com/hmcts/ccd-data-store-api","homepage":"","size":799,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls/8"},"html":{"href":"https://github.com/hmcts/ccd-data-store-api/pull/8"},"issue":{"href":"https://api.github.com/repos/hmcts/ccd-data-store-api/issues/8"},"comments":{"href":"https://api.github.com/repos/hmcts/ccd-data-store-api/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hmcts/ccd-data-store-api/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/hmcts/ccd-data-store-api/statuses/678ca4222ff7c4f0ebad83da290fa6c694c2c5d2"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vlaurin"}}