payload: {"action":"created","comment":{"url":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls/comments/366369957","pull_request_review_id":342536504,"id":366369957,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDM2NjM2OTk1Nw==","diff_hunk":"@@ -0,0 +1,86 @@\n+package accounts;\n+\n+\n+import accounts.pojos.AccountData;\n+import accounts.pojos.CreateAccountRequest;\n+import com.fasterxml.jackson.databind.ObjectMapper;\n+import exceptions.DbAccessException;\n+\n+import javax.ws.rs.InternalServerErrorException;\n+import javax.ws.rs.NotAuthorizedException;\n+import javax.ws.rs.client.Client;\n+import javax.ws.rs.client.ClientBuilder;\n+import javax.ws.rs.client.Entity;\n+import javax.ws.rs.core.Response;\n+import javax.xml.bind.DataBindingException;\n+import java.io.IOException;\n+import java.util.Optional;\n+\n+public class AccountsClient {\n+\n+    private final String accountsManagerBaseUri;\n+    ObjectMapper mapper = new ObjectMapper();\n+\n+\n+    public AccountsClient(String accountsManagerBaseUri) {\n+        this.accountsManagerBaseUri = accountsManagerBaseUri;\n+    }\n+\n+    public Optional<AccountData> getAccount(String accountToken) throws DbAccessException {\n+        Client client = ClientBuilder.newClient();\n+        String getAccountUri = accountsManagerBaseUri + \"/accounts\";\n+        Response response = client.target(getAccountUri)\n+                .request().header(\"X-ACCOUNT-TOKEN\", accountToken).get();\n+\n+        if (response.getStatusInfo().equals(Response.Status.UNAUTHORIZED)) {\n+            return Optional.ofNullable(null);\n+        }\n+        else if (!response.getStatusInfo().equals(Response.Status.OK)) {\n+            throw new DbAccessException(\"Couldn't retrieve account\");\n+        }\n+        else {","path":"AccountsManager/client/src/main/java/accounts/AccountsClient.java","position":41,"original_position":41,"commit_id":"4fb629eb89f6e48af7a45146bc858cd1c5334943","original_commit_id":"4fb629eb89f6e48af7a45146bc858cd1c5334943","user":{"login":"naorgu","id":9825512,"node_id":"MDQ6VXNlcjk4MjU1MTI=","avatar_url":"https://avatars2.githubusercontent.com/u/9825512?v=4","gravatar_id":"","url":"https://api.github.com/users/naorgu","html_url":"https://github.com/naorgu","followers_url":"https://api.github.com/users/naorgu/followers","following_url":"https://api.github.com/users/naorgu/following{/other_user}","gists_url":"https://api.github.com/users/naorgu/gists{/gist_id}","starred_url":"https://api.github.com/users/naorgu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naorgu/subscriptions","organizations_url":"https://api.github.com/users/naorgu/orgs","repos_url":"https://api.github.com/users/naorgu/repos","events_url":"https://api.github.com/users/naorgu/events{/privacy}","received_events_url":"https://api.github.com/users/naorgu/received_events","type":"User","site_admin":false},"body":"You don't have to put `else` here","created_at":"2020-01-14T14:31:15Z","updated_at":"2020-01-14T14:49:19Z","html_url":"https://github.com/guyKremer/boot-bootcamp/pull/7#discussion_r366369957","pull_request_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls/7","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls/comments/366369957"},"html":{"href":"https://github.com/guyKremer/boot-bootcamp/pull/7#discussion_r366369957"},"pull_request":{"href":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls/7","id":362112135,"node_id":"MDExOlB1bGxSZXF1ZXN0MzYyMTEyMTM1","html_url":"https://github.com/guyKremer/boot-bootcamp/pull/7","diff_url":"https://github.com/guyKremer/boot-bootcamp/pull/7.diff","patch_url":"https://github.com/guyKremer/boot-bootcamp/pull/7.patch","issue_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/issues/7","number":7,"state":"open","locked":false,"title":"Multi-tenancy exercise ","user":{"login":"guyKremer","id":42372467,"node_id":"MDQ6VXNlcjQyMzcyNDY3","avatar_url":"https://avatars3.githubusercontent.com/u/42372467?v=4","gravatar_id":"","url":"https://api.github.com/users/guyKremer","html_url":"https://github.com/guyKremer","followers_url":"https://api.github.com/users/guyKremer/followers","following_url":"https://api.github.com/users/guyKremer/following{/other_user}","gists_url":"https://api.github.com/users/guyKremer/gists{/gist_id}","starred_url":"https://api.github.com/users/guyKremer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyKremer/subscriptions","organizations_url":"https://api.github.com/users/guyKremer/orgs","repos_url":"https://api.github.com/users/guyKremer/repos","events_url":"https://api.github.com/users/guyKremer/events{/privacy}","received_events_url":"https://api.github.com/users/guyKremer/received_events","type":"User","site_admin":false},"body":"","created_at":"2020-01-13T13:18:05Z","updated_at":"2020-01-14T14:49:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d60fea5e08fc18a408168540fe518f23f48cada9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls/7/commits","review_comments_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls/7/comments","review_comment_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/issues/7/comments","statuses_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/statuses/4fb629eb89f6e48af7a45146bc858cd1c5334943","head":{"label":"guyKremer:multi-tenancy","ref":"multi-tenancy","sha":"4fb629eb89f6e48af7a45146bc858cd1c5334943","user":{"login":"guyKremer","id":42372467,"node_id":"MDQ6VXNlcjQyMzcyNDY3","avatar_url":"https://avatars3.githubusercontent.com/u/42372467?v=4","gravatar_id":"","url":"https://api.github.com/users/guyKremer","html_url":"https://github.com/guyKremer","followers_url":"https://api.github.com/users/guyKremer/followers","following_url":"https://api.github.com/users/guyKremer/following{/other_user}","gists_url":"https://api.github.com/users/guyKremer/gists{/gist_id}","starred_url":"https://api.github.com/users/guyKremer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyKremer/subscriptions","organizations_url":"https://api.github.com/users/guyKremer/orgs","repos_url":"https://api.github.com/users/guyKremer/repos","events_url":"https://api.github.com/users/guyKremer/events{/privacy}","received_events_url":"https://api.github.com/users/guyKremer/received_events","type":"User","site_admin":false},"repo":{"id":222648668,"node_id":"MDEwOlJlcG9zaXRvcnkyMjI2NDg2Njg=","name":"boot-bootcamp","full_name":"guyKremer/boot-bootcamp","private":false,"owner":{"login":"guyKremer","id":42372467,"node_id":"MDQ6VXNlcjQyMzcyNDY3","avatar_url":"https://avatars3.githubusercontent.com/u/42372467?v=4","gravatar_id":"","url":"https://api.github.com/users/guyKremer","html_url":"https://github.com/guyKremer","followers_url":"https://api.github.com/users/guyKremer/followers","following_url":"https://api.github.com/users/guyKremer/following{/other_user}","gists_url":"https://api.github.com/users/guyKremer/gists{/gist_id}","starred_url":"https://api.github.com/users/guyKremer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyKremer/subscriptions","organizations_url":"https://api.github.com/users/guyKremer/orgs","repos_url":"https://api.github.com/users/guyKremer/repos","events_url":"https://api.github.com/users/guyKremer/events{/privacy}","received_events_url":"https://api.github.com/users/guyKremer/received_events","type":"User","site_admin":false},"html_url":"https://github.com/guyKremer/boot-bootcamp","description":null,"fork":false,"url":"https://api.github.com/repos/guyKremer/boot-bootcamp","forks_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/forks","keys_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/teams","hooks_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/hooks","issue_events_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/issues/events{/number}","events_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/events","assignees_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/assignees{/user}","branches_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/branches{/branch}","tags_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/tags","blobs_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/git/refs{/sha}","trees_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/statuses/{sha}","languages_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/languages","stargazers_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/stargazers","contributors_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/contributors","subscribers_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/subscribers","subscription_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/subscription","commits_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/commits{/sha}","git_commits_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/git/commits{/sha}","comments_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/comments{/number}","issue_comment_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/issues/comments{/number}","contents_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/contents/{+path}","compare_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/merges","archive_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/downloads","issues_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/issues{/number}","pulls_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls{/number}","milestones_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/milestones{/number}","notifications_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/labels{/name}","releases_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/releases{/id}","deployments_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/deployments","created_at":"2019-11-19T08:41:10Z","updated_at":"2020-01-12T13:27:53Z","pushed_at":"2020-01-14T13:53:07Z","git_url":"git://github.com/guyKremer/boot-bootcamp.git","ssh_url":"git@github.com:guyKremer/boot-bootcamp.git","clone_url":"https://github.com/guyKremer/boot-bootcamp.git","svn_url":"https://github.com/guyKremer/boot-bootcamp","homepage":null,"size":133639,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"guyKremer:master","ref":"master","sha":"93c969bccd270afd2617ebfc54f45c983305ae40","user":{"login":"guyKremer","id":42372467,"node_id":"MDQ6VXNlcjQyMzcyNDY3","avatar_url":"https://avatars3.githubusercontent.com/u/42372467?v=4","gravatar_id":"","url":"https://api.github.com/users/guyKremer","html_url":"https://github.com/guyKremer","followers_url":"https://api.github.com/users/guyKremer/followers","following_url":"https://api.github.com/users/guyKremer/following{/other_user}","gists_url":"https://api.github.com/users/guyKremer/gists{/gist_id}","starred_url":"https://api.github.com/users/guyKremer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyKremer/subscriptions","organizations_url":"https://api.github.com/users/guyKremer/orgs","repos_url":"https://api.github.com/users/guyKremer/repos","events_url":"https://api.github.com/users/guyKremer/events{/privacy}","received_events_url":"https://api.github.com/users/guyKremer/received_events","type":"User","site_admin":false},"repo":{"id":222648668,"node_id":"MDEwOlJlcG9zaXRvcnkyMjI2NDg2Njg=","name":"boot-bootcamp","full_name":"guyKremer/boot-bootcamp","private":false,"owner":{"login":"guyKremer","id":42372467,"node_id":"MDQ6VXNlcjQyMzcyNDY3","avatar_url":"https://avatars3.githubusercontent.com/u/42372467?v=4","gravatar_id":"","url":"https://api.github.com/users/guyKremer","html_url":"https://github.com/guyKremer","followers_url":"https://api.github.com/users/guyKremer/followers","following_url":"https://api.github.com/users/guyKremer/following{/other_user}","gists_url":"https://api.github.com/users/guyKremer/gists{/gist_id}","starred_url":"https://api.github.com/users/guyKremer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyKremer/subscriptions","organizations_url":"https://api.github.com/users/guyKremer/orgs","repos_url":"https://api.github.com/users/guyKremer/repos","events_url":"https://api.github.com/users/guyKremer/events{/privacy}","received_events_url":"https://api.github.com/users/guyKremer/received_events","type":"User","site_admin":false},"html_url":"https://github.com/guyKremer/boot-bootcamp","description":null,"fork":false,"url":"https://api.github.com/repos/guyKremer/boot-bootcamp","forks_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/forks","keys_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/teams","hooks_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/hooks","issue_events_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/issues/events{/number}","events_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/events","assignees_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/assignees{/user}","branches_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/branches{/branch}","tags_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/tags","blobs_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/git/refs{/sha}","trees_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/statuses/{sha}","languages_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/languages","stargazers_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/stargazers","contributors_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/contributors","subscribers_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/subscribers","subscription_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/subscription","commits_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/commits{/sha}","git_commits_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/git/commits{/sha}","comments_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/comments{/number}","issue_comment_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/issues/comments{/number}","contents_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/contents/{+path}","compare_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/merges","archive_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/downloads","issues_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/issues{/number}","pulls_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls{/number}","milestones_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/milestones{/number}","notifications_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/labels{/name}","releases_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/releases{/id}","deployments_url":"https://api.github.com/repos/guyKremer/boot-bootcamp/deployments","created_at":"2019-11-19T08:41:10Z","updated_at":"2020-01-12T13:27:53Z","pushed_at":"2020-01-14T13:53:07Z","git_url":"git://github.com/guyKremer/boot-bootcamp.git","ssh_url":"git@github.com:guyKremer/boot-bootcamp.git","clone_url":"https://github.com/guyKremer/boot-bootcamp.git","svn_url":"https://github.com/guyKremer/boot-bootcamp","homepage":null,"size":133639,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls/7"},"html":{"href":"https://github.com/guyKremer/boot-bootcamp/pull/7"},"issue":{"href":"https://api.github.com/repos/guyKremer/boot-bootcamp/issues/7"},"comments":{"href":"https://api.github.com/repos/guyKremer/boot-bootcamp/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guyKremer/boot-bootcamp/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/guyKremer/boot-bootcamp/statuses/4fb629eb89f6e48af7a45146bc858cd1c5334943"}},"author_association":"OWNER"}}
other: {"actor":{"display_login":"naorgu"}}