{"action":"created","comment":{"url":"https://api.github.com/repos/hmcts/java-logging/pulls/comments/145648891","pull_request_review_id":70476398,"id":145648891,"diff_hunk":"@@ -50,24 +52,41 @@ public void listenForEvents() throws JoranException, IOException {\n     @Test\n     public void requestProcessedMessageShouldBeLoggedForPublicResource() throws Exception {\n         ResponseEntity<String> response = restTemplate.getForEntity(\"/public\", String.class);\n+\n         assertThat(response.getBody()).isEqualTo(\"OK\");\n-        assertThat(loggedEvents()).extracting(\"message\").containsOnlyOnce(\"Request processed\");\n+        assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);\n+\n+        Thread.sleep(10);// how to fix this? test fails to see the log message otherwise\n+\n+        assertThat(loggedEvents().stream().filter(\n+            event -> event.getFormattedMessage().startsWith(\"Request GET /public processed\")\n+        ).collect(Collectors.toList())).size().isEqualTo(1);\n     }\n \n     @Test\n     public void requestProcessedMessageShouldBeLoggedForProtectedResource() throws Exception {\n         // making sure our Filters are placed outside SecurityFilterChain\n         // and get executed no matter request is allowed or not\n         ResponseEntity<String> response = restTemplate.getForEntity(\"/protected\", String.class);\n+\n         assertThat(response.getBody()).isNotEqualTo(\"OK\");\n-        assertThat(loggedEvents()).extracting(\"message\").containsOnlyOnce(\"Request processed\");\n+        assertThat(response.getStatusCode()).isEqualTo(HttpStatus.FORBIDDEN);\n+\n+        assertThat(loggedEvents().stream().filter(\n+            event -> event.getFormattedMessage().startsWith(\"Request GET /protected processed\")\n+        ).collect(Collectors.toList())).size().isEqualTo(1);","path":"java-logging-spring/src/test/java/uk/gov/hmcts/reform/logging/spring/RequestLoggingComponentTest.java","position":69,"original_position":44,"commit_id":"fb36f2c8f6e710990812557240f3e8749172ae00","original_commit_id":"88793e1beeb8c2bd56cc893703a35b2d649b5342","user":{"login":"KarolJastrzebski","id":5228657,"avatar_url":"https://avatars2.githubusercontent.com/u/5228657?v=4","gravatar_id":"","url":"https://api.github.com/users/KarolJastrzebski","html_url":"https://github.com/KarolJastrzebski","followers_url":"https://api.github.com/users/KarolJastrzebski/followers","following_url":"https://api.github.com/users/KarolJastrzebski/following{/other_user}","gists_url":"https://api.github.com/users/KarolJastrzebski/gists{/gist_id}","starred_url":"https://api.github.com/users/KarolJastrzebski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KarolJastrzebski/subscriptions","organizations_url":"https://api.github.com/users/KarolJastrzebski/orgs","repos_url":"https://api.github.com/users/KarolJastrzebski/repos","events_url":"https://api.github.com/users/KarolJastrzebski/events{/privacy}","received_events_url":"https://api.github.com/users/KarolJastrzebski/received_events","type":"User","site_admin":false},"body":"Why changing styles from assertj to hamcrest? This looks very verbose in comparison to the replaced approach.","created_at":"2017-10-19T09:43:20Z","updated_at":"2017-10-19T10:01:10Z","html_url":"https://github.com/hmcts/java-logging/pull/10#discussion_r145648891","pull_request_url":"https://api.github.com/repos/hmcts/java-logging/pulls/10","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/hmcts/java-logging/pulls/comments/145648891"},"html":{"href":"https://github.com/hmcts/java-logging/pull/10#discussion_r145648891"},"pull_request":{"href":"https://api.github.com/repos/hmcts/java-logging/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/hmcts/java-logging/pulls/10","id":146754257,"html_url":"https://github.com/hmcts/java-logging/pull/10","diff_url":"https://github.com/hmcts/java-logging/pull/10.diff","patch_url":"https://github.com/hmcts/java-logging/pull/10.patch","issue_url":"https://api.github.com/repos/hmcts/java-logging/issues/10","number":10,"state":"open","locked":false,"title":"Improving logging message, coverage","user":{"login":"doncem","id":1420191,"avatar_url":"https://avatars3.githubusercontent.com/u/1420191?v=4","gravatar_id":"","url":"https://api.github.com/users/doncem","html_url":"https://github.com/doncem","followers_url":"https://api.github.com/users/doncem/followers","following_url":"https://api.github.com/users/doncem/following{/other_user}","gists_url":"https://api.github.com/users/doncem/gists{/gist_id}","starred_url":"https://api.github.com/users/doncem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doncem/subscriptions","organizations_url":"https://api.github.com/users/doncem/orgs","repos_url":"https://api.github.com/users/doncem/repos","events_url":"https://api.github.com/users/doncem/events{/privacy}","received_events_url":"https://api.github.com/users/doncem/received_events","type":"User","site_admin":false},"body":"Notes:\r\n- [ ] Accumulated multi-project coverage report uploaded to Codacy\r\n- [ ] Travis only runs against master and feature branches\r\n- [x] Request log message improvement:\r\n  - removed arbitrary markers containing request uri, time the response took. Giving this information in the message\r\n  - leaving request method and response code. I doubt method is needed\r\n- [x] Log format slightly adjusted:\r\n  - adding date format\r\n  - adding log level spacing\r\n  - reducing namespace clog\r\n  - adding line number","created_at":"2017-10-16T10:56:59Z","updated_at":"2017-10-19T10:01:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3e88ea1a31756e0e2af4f42ad921744b9622588","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/hmcts/java-logging/pulls/10/commits","review_comments_url":"https://api.github.com/repos/hmcts/java-logging/pulls/10/comments","review_comment_url":"https://api.github.com/repos/hmcts/java-logging/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hmcts/java-logging/issues/10/comments","statuses_url":"https://api.github.com/repos/hmcts/java-logging/statuses/fb36f2c8f6e710990812557240f3e8749172ae00","head":{"label":"hmcts:don/coverage-improvement","ref":"don/coverage-improvement","sha":"fb36f2c8f6e710990812557240f3e8749172ae00","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":94910222,"name":"java-logging","full_name":"hmcts/java-logging","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/java-logging","description":null,"fork":false,"url":"https://api.github.com/repos/hmcts/java-logging","forks_url":"https://api.github.com/repos/hmcts/java-logging/forks","keys_url":"https://api.github.com/repos/hmcts/java-logging/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmcts/java-logging/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmcts/java-logging/teams","hooks_url":"https://api.github.com/repos/hmcts/java-logging/hooks","issue_events_url":"https://api.github.com/repos/hmcts/java-logging/issues/events{/number}","events_url":"https://api.github.com/repos/hmcts/java-logging/events","assignees_url":"https://api.github.com/repos/hmcts/java-logging/assignees{/user}","branches_url":"https://api.github.com/repos/hmcts/java-logging/branches{/branch}","tags_url":"https://api.github.com/repos/hmcts/java-logging/tags","blobs_url":"https://api.github.com/repos/hmcts/java-logging/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmcts/java-logging/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmcts/java-logging/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmcts/java-logging/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmcts/java-logging/statuses/{sha}","languages_url":"https://api.github.com/repos/hmcts/java-logging/languages","stargazers_url":"https://api.github.com/repos/hmcts/java-logging/stargazers","contributors_url":"https://api.github.com/repos/hmcts/java-logging/contributors","subscribers_url":"https://api.github.com/repos/hmcts/java-logging/subscribers","subscription_url":"https://api.github.com/repos/hmcts/java-logging/subscription","commits_url":"https://api.github.com/repos/hmcts/java-logging/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmcts/java-logging/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmcts/java-logging/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmcts/java-logging/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmcts/java-logging/contents/{+path}","compare_url":"https://api.github.com/repos/hmcts/java-logging/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmcts/java-logging/merges","archive_url":"https://api.github.com/repos/hmcts/java-logging/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmcts/java-logging/downloads","issues_url":"https://api.github.com/repos/hmcts/java-logging/issues{/number}","pulls_url":"https://api.github.com/repos/hmcts/java-logging/pulls{/number}","milestones_url":"https://api.github.com/repos/hmcts/java-logging/milestones{/number}","notifications_url":"https://api.github.com/repos/hmcts/java-logging/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmcts/java-logging/labels{/name}","releases_url":"https://api.github.com/repos/hmcts/java-logging/releases{/id}","deployments_url":"https://api.github.com/repos/hmcts/java-logging/deployments","created_at":"2017-06-20T16:03:16Z","updated_at":"2017-06-21T15:39:53Z","pushed_at":"2017-10-19T09:34:58Z","git_url":"git://github.com/hmcts/java-logging.git","ssh_url":"git@github.com:hmcts/java-logging.git","clone_url":"https://github.com/hmcts/java-logging.git","svn_url":"https://github.com/hmcts/java-logging","homepage":null,"size":264,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"hmcts:feature/RPE-16/coverage","ref":"feature/RPE-16/coverage","sha":"660a5a2195316a4feffc88e6b7537c760104fc7a","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":94910222,"name":"java-logging","full_name":"hmcts/java-logging","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/java-logging","description":null,"fork":false,"url":"https://api.github.com/repos/hmcts/java-logging","forks_url":"https://api.github.com/repos/hmcts/java-logging/forks","keys_url":"https://api.github.com/repos/hmcts/java-logging/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmcts/java-logging/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmcts/java-logging/teams","hooks_url":"https://api.github.com/repos/hmcts/java-logging/hooks","issue_events_url":"https://api.github.com/repos/hmcts/java-logging/issues/events{/number}","events_url":"https://api.github.com/repos/hmcts/java-logging/events","assignees_url":"https://api.github.com/repos/hmcts/java-logging/assignees{/user}","branches_url":"https://api.github.com/repos/hmcts/java-logging/branches{/branch}","tags_url":"https://api.github.com/repos/hmcts/java-logging/tags","blobs_url":"https://api.github.com/repos/hmcts/java-logging/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmcts/java-logging/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmcts/java-logging/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmcts/java-logging/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmcts/java-logging/statuses/{sha}","languages_url":"https://api.github.com/repos/hmcts/java-logging/languages","stargazers_url":"https://api.github.com/repos/hmcts/java-logging/stargazers","contributors_url":"https://api.github.com/repos/hmcts/java-logging/contributors","subscribers_url":"https://api.github.com/repos/hmcts/java-logging/subscribers","subscription_url":"https://api.github.com/repos/hmcts/java-logging/subscription","commits_url":"https://api.github.com/repos/hmcts/java-logging/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmcts/java-logging/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmcts/java-logging/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmcts/java-logging/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmcts/java-logging/contents/{+path}","compare_url":"https://api.github.com/repos/hmcts/java-logging/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmcts/java-logging/merges","archive_url":"https://api.github.com/repos/hmcts/java-logging/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmcts/java-logging/downloads","issues_url":"https://api.github.com/repos/hmcts/java-logging/issues{/number}","pulls_url":"https://api.github.com/repos/hmcts/java-logging/pulls{/number}","milestones_url":"https://api.github.com/repos/hmcts/java-logging/milestones{/number}","notifications_url":"https://api.github.com/repos/hmcts/java-logging/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmcts/java-logging/labels{/name}","releases_url":"https://api.github.com/repos/hmcts/java-logging/releases{/id}","deployments_url":"https://api.github.com/repos/hmcts/java-logging/deployments","created_at":"2017-06-20T16:03:16Z","updated_at":"2017-06-21T15:39:53Z","pushed_at":"2017-10-19T09:34:58Z","git_url":"git://github.com/hmcts/java-logging.git","ssh_url":"git@github.com:hmcts/java-logging.git","clone_url":"https://github.com/hmcts/java-logging.git","svn_url":"https://github.com/hmcts/java-logging","homepage":null,"size":264,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hmcts/java-logging/pulls/10"},"html":{"href":"https://github.com/hmcts/java-logging/pull/10"},"issue":{"href":"https://api.github.com/repos/hmcts/java-logging/issues/10"},"comments":{"href":"https://api.github.com/repos/hmcts/java-logging/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/hmcts/java-logging/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/hmcts/java-logging/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hmcts/java-logging/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/hmcts/java-logging/statuses/fb36f2c8f6e710990812557240f3e8749172ae00"}},"author_association":"NONE"}}
{"actor":{"display_login":"KarolJastrzebski"}}