{"action":"created","comment":{"url":"https://api.github.com/repos/paypal/squbs/pulls/comments/93110827","pull_request_review_id":13632881,"id":93110827,"diff_hunk":"@@ -0,0 +1,119 @@\n+/*\n+ * Copyright 2015 PayPal\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.squbs.httpclient;\n+\n+import akka.NotUsed;\n+import akka.actor.ActorSystem;\n+import akka.http.javadsl.ConnectHttp;\n+import akka.http.javadsl.HostConnectionPool;\n+import akka.http.javadsl.Http;\n+import akka.http.javadsl.ServerBinding;\n+import akka.http.javadsl.model.*;\n+import akka.http.javadsl.server.AllDirectives;\n+import akka.http.javadsl.server.Route;\n+import akka.japi.Pair;\n+import akka.stream.ActorMaterializer;\n+import akka.stream.javadsl.Flow;\n+import akka.stream.javadsl.Sink;\n+import akka.stream.javadsl.Source;\n+import org.junit.AfterClass;\n+import org.junit.Test;\n+import org.squbs.endpoint.Endpoint;\n+import org.squbs.endpoint.EndpointResolverRegistry;\n+import org.squbs.testkit.Timeouts;\n+import scala.util.Try;\n+\n+import java.util.Optional;\n+import java.util.concurrent.CompletionStage;\n+\n+import static org.junit.Assert.assertEquals;\n+\n+public class ClientFlowTest {\n+\n+    private static final ActorSystem system = ActorSystem.create(\"ClientFlowTest\");\n+    private static final ActorMaterializer mat = ActorMaterializer.create(system);\n+    private static final Flow<HttpRequest, HttpResponse, NotUsed> flow = new MyRoute().route().flow(system, mat);\n+\n+    private static ServerBinding binding;\n+    static {\n+        try {\n+            binding = Http.get(system).\n+                    bindAndHandle(flow, ConnectHttp.toHost(\"localhost\", 65529), mat).\n+                    toCompletableFuture().get();\n+        } catch(Exception e) {\n+            binding = null;\n+        }\n+\n+    }\n+    private static final ServerBinding serverBinding = binding;\n+    private static final int port = serverBinding.localAddress().getPort();\n+\n+    private final Flow<Pair<HttpRequest, Integer>, Pair<Try<HttpResponse>, Integer>, HostConnectionPool> clientFlow;\n+\n+    static {\n+        EndpointResolverRegistry.get(system).register(\"LocalhostEndpointResolver\", (svcName, env) -> {\n+            if (\"hello\".equals(svcName)) {\n+                return Optional.of(Endpoint.create(\"http://localhost:\" + port));\n+            }\n+            return Optional.empty();\n+        });\n+    }\n+\n+    public ClientFlowTest() {\n+        clientFlow = ClientFlow.create(\"hello\", system, mat);\n+    }\n+\n+    CompletionStage<Try<HttpResponse>> doRequest(HttpRequest request) {","path":"squbs-httpclient/src/test/java/org/squbs/httpclient/ClientFlowTest.java","position":79,"original_position":79,"commit_id":"5ba4d72a1063af0535f4bedc065a5132f5952874","original_commit_id":"5ba4d72a1063af0535f4bedc065a5132f5952874","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars.githubusercontent.com/u/19940114?v=3","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Use explicit scoping instead of the default package private level](https://www.codacy.com/app/akara-sucharitakul/squbs/file/4775047622/issues/source?bid=2834325&fileBranchId=4005728#l79)","created_at":"2016-12-19T20:16:50Z","updated_at":"2016-12-19T20:16:50Z","html_url":"https://github.com/paypal/squbs/pull/360#discussion_r93110827","pull_request_url":"https://api.github.com/repos/paypal/squbs/pulls/360","_links":{"self":{"href":"https://api.github.com/repos/paypal/squbs/pulls/comments/93110827"},"html":{"href":"https://github.com/paypal/squbs/pull/360#discussion_r93110827"},"pull_request":{"href":"https://api.github.com/repos/paypal/squbs/pulls/360"}}},"pull_request":{"url":"https://api.github.com/repos/paypal/squbs/pulls/360","id":98425496,"html_url":"https://github.com/paypal/squbs/pull/360","diff_url":"https://github.com/paypal/squbs/pull/360.diff","patch_url":"https://github.com/paypal/squbs/pull/360.patch","issue_url":"https://api.github.com/repos/paypal/squbs/issues/360","number":360,"state":"open","locked":false,"title":"#348: Added Java API to ClientFlow and updated resolver registration API","user":{"login":"akara","id":77111,"avatar_url":"https://avatars.githubusercontent.com/u/77111?v=3","gravatar_id":"","url":"https://api.github.com/users/akara","html_url":"https://github.com/akara","followers_url":"https://api.github.com/users/akara/followers","following_url":"https://api.github.com/users/akara/following{/other_user}","gists_url":"https://api.github.com/users/akara/gists{/gist_id}","starred_url":"https://api.github.com/users/akara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akara/subscriptions","organizations_url":"https://api.github.com/users/akara/orgs","repos_url":"https://api.github.com/users/akara/repos","events_url":"https://api.github.com/users/akara/events{/privacy}","received_events_url":"https://api.github.com/users/akara/received_events","type":"User","site_admin":false},"body":"Thanks for your pull request.  Please review the following guidelines.\r\n\r\n- [X] Title includes issue id.\r\n- [X] Description of the change added.\r\n- [X] Commits are squashed.\r\n- [X] Tests added.\r\n- [X] Documentation added/updated.\r\n- [X] Also please review [CONTRIBUTING.md](https://github.com/paypal/squbs/blob/master/CONTRIBUTING.md).","created_at":"2016-12-17T00:44:46Z","updated_at":"2016-12-19T20:16:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d410f34c35c6f7c9562f105bc91dcbe091446f8f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/paypal/squbs/pulls/360/commits","review_comments_url":"https://api.github.com/repos/paypal/squbs/pulls/360/comments","review_comment_url":"https://api.github.com/repos/paypal/squbs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paypal/squbs/issues/360/comments","statuses_url":"https://api.github.com/repos/paypal/squbs/statuses/5ba4d72a1063af0535f4bedc065a5132f5952874","head":{"label":"akara:issue348","ref":"issue348","sha":"5ba4d72a1063af0535f4bedc065a5132f5952874","user":{"login":"akara","id":77111,"avatar_url":"https://avatars.githubusercontent.com/u/77111?v=3","gravatar_id":"","url":"https://api.github.com/users/akara","html_url":"https://github.com/akara","followers_url":"https://api.github.com/users/akara/followers","following_url":"https://api.github.com/users/akara/following{/other_user}","gists_url":"https://api.github.com/users/akara/gists{/gist_id}","starred_url":"https://api.github.com/users/akara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akara/subscriptions","organizations_url":"https://api.github.com/users/akara/orgs","repos_url":"https://api.github.com/users/akara/repos","events_url":"https://api.github.com/users/akara/events{/privacy}","received_events_url":"https://api.github.com/users/akara/received_events","type":"User","site_admin":false},"repo":{"id":40934086,"name":"squbs","full_name":"akara/squbs","owner":{"login":"akara","id":77111,"avatar_url":"https://avatars.githubusercontent.com/u/77111?v=3","gravatar_id":"","url":"https://api.github.com/users/akara","html_url":"https://github.com/akara","followers_url":"https://api.github.com/users/akara/followers","following_url":"https://api.github.com/users/akara/following{/other_user}","gists_url":"https://api.github.com/users/akara/gists{/gist_id}","starred_url":"https://api.github.com/users/akara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akara/subscriptions","organizations_url":"https://api.github.com/users/akara/orgs","repos_url":"https://api.github.com/users/akara/repos","events_url":"https://api.github.com/users/akara/events{/privacy}","received_events_url":"https://api.github.com/users/akara/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akara/squbs","description":null,"fork":true,"url":"https://api.github.com/repos/akara/squbs","forks_url":"https://api.github.com/repos/akara/squbs/forks","keys_url":"https://api.github.com/repos/akara/squbs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akara/squbs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akara/squbs/teams","hooks_url":"https://api.github.com/repos/akara/squbs/hooks","issue_events_url":"https://api.github.com/repos/akara/squbs/issues/events{/number}","events_url":"https://api.github.com/repos/akara/squbs/events","assignees_url":"https://api.github.com/repos/akara/squbs/assignees{/user}","branches_url":"https://api.github.com/repos/akara/squbs/branches{/branch}","tags_url":"https://api.github.com/repos/akara/squbs/tags","blobs_url":"https://api.github.com/repos/akara/squbs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akara/squbs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akara/squbs/git/refs{/sha}","trees_url":"https://api.github.com/repos/akara/squbs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akara/squbs/statuses/{sha}","languages_url":"https://api.github.com/repos/akara/squbs/languages","stargazers_url":"https://api.github.com/repos/akara/squbs/stargazers","contributors_url":"https://api.github.com/repos/akara/squbs/contributors","subscribers_url":"https://api.github.com/repos/akara/squbs/subscribers","subscription_url":"https://api.github.com/repos/akara/squbs/subscription","commits_url":"https://api.github.com/repos/akara/squbs/commits{/sha}","git_commits_url":"https://api.github.com/repos/akara/squbs/git/commits{/sha}","comments_url":"https://api.github.com/repos/akara/squbs/comments{/number}","issue_comment_url":"https://api.github.com/repos/akara/squbs/issues/comments{/number}","contents_url":"https://api.github.com/repos/akara/squbs/contents/{+path}","compare_url":"https://api.github.com/repos/akara/squbs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akara/squbs/merges","archive_url":"https://api.github.com/repos/akara/squbs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akara/squbs/downloads","issues_url":"https://api.github.com/repos/akara/squbs/issues{/number}","pulls_url":"https://api.github.com/repos/akara/squbs/pulls{/number}","milestones_url":"https://api.github.com/repos/akara/squbs/milestones{/number}","notifications_url":"https://api.github.com/repos/akara/squbs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akara/squbs/labels{/name}","releases_url":"https://api.github.com/repos/akara/squbs/releases{/id}","deployments_url":"https://api.github.com/repos/akara/squbs/deployments","created_at":"2015-08-17T22:35:29Z","updated_at":"2016-05-05T19:23:24Z","pushed_at":"2016-12-19T20:14:48Z","git_url":"git://github.com/akara/squbs.git","ssh_url":"git@github.com:akara/squbs.git","clone_url":"https://github.com/akara/squbs.git","svn_url":"https://github.com/akara/squbs","homepage":null,"size":6539,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"paypal:master","ref":"master","sha":"0092355c0ee34d11a14db63558c39f4a7acdead1","user":{"login":"paypal","id":476675,"avatar_url":"https://avatars.githubusercontent.com/u/476675?v=3","gravatar_id":"","url":"https://api.github.com/users/paypal","html_url":"https://github.com/paypal","followers_url":"https://api.github.com/users/paypal/followers","following_url":"https://api.github.com/users/paypal/following{/other_user}","gists_url":"https://api.github.com/users/paypal/gists{/gist_id}","starred_url":"https://api.github.com/users/paypal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paypal/subscriptions","organizations_url":"https://api.github.com/users/paypal/orgs","repos_url":"https://api.github.com/users/paypal/repos","events_url":"https://api.github.com/users/paypal/events{/privacy}","received_events_url":"https://api.github.com/users/paypal/received_events","type":"Organization","site_admin":false},"repo":{"id":38714007,"name":"squbs","full_name":"paypal/squbs","owner":{"login":"paypal","id":476675,"avatar_url":"https://avatars.githubusercontent.com/u/476675?v=3","gravatar_id":"","url":"https://api.github.com/users/paypal","html_url":"https://github.com/paypal","followers_url":"https://api.github.com/users/paypal/followers","following_url":"https://api.github.com/users/paypal/following{/other_user}","gists_url":"https://api.github.com/users/paypal/gists{/gist_id}","starred_url":"https://api.github.com/users/paypal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paypal/subscriptions","organizations_url":"https://api.github.com/users/paypal/orgs","repos_url":"https://api.github.com/users/paypal/repos","events_url":"https://api.github.com/users/paypal/events{/privacy}","received_events_url":"https://api.github.com/users/paypal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paypal/squbs","description":"Akka/Spray for Large-Scale Production Deployments","fork":false,"url":"https://api.github.com/repos/paypal/squbs","forks_url":"https://api.github.com/repos/paypal/squbs/forks","keys_url":"https://api.github.com/repos/paypal/squbs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paypal/squbs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paypal/squbs/teams","hooks_url":"https://api.github.com/repos/paypal/squbs/hooks","issue_events_url":"https://api.github.com/repos/paypal/squbs/issues/events{/number}","events_url":"https://api.github.com/repos/paypal/squbs/events","assignees_url":"https://api.github.com/repos/paypal/squbs/assignees{/user}","branches_url":"https://api.github.com/repos/paypal/squbs/branches{/branch}","tags_url":"https://api.github.com/repos/paypal/squbs/tags","blobs_url":"https://api.github.com/repos/paypal/squbs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paypal/squbs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paypal/squbs/git/refs{/sha}","trees_url":"https://api.github.com/repos/paypal/squbs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paypal/squbs/statuses/{sha}","languages_url":"https://api.github.com/repos/paypal/squbs/languages","stargazers_url":"https://api.github.com/repos/paypal/squbs/stargazers","contributors_url":"https://api.github.com/repos/paypal/squbs/contributors","subscribers_url":"https://api.github.com/repos/paypal/squbs/subscribers","subscription_url":"https://api.github.com/repos/paypal/squbs/subscription","commits_url":"https://api.github.com/repos/paypal/squbs/commits{/sha}","git_commits_url":"https://api.github.com/repos/paypal/squbs/git/commits{/sha}","comments_url":"https://api.github.com/repos/paypal/squbs/comments{/number}","issue_comment_url":"https://api.github.com/repos/paypal/squbs/issues/comments{/number}","contents_url":"https://api.github.com/repos/paypal/squbs/contents/{+path}","compare_url":"https://api.github.com/repos/paypal/squbs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paypal/squbs/merges","archive_url":"https://api.github.com/repos/paypal/squbs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paypal/squbs/downloads","issues_url":"https://api.github.com/repos/paypal/squbs/issues{/number}","pulls_url":"https://api.github.com/repos/paypal/squbs/pulls{/number}","milestones_url":"https://api.github.com/repos/paypal/squbs/milestones{/number}","notifications_url":"https://api.github.com/repos/paypal/squbs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paypal/squbs/labels{/name}","releases_url":"https://api.github.com/repos/paypal/squbs/releases{/id}","deployments_url":"https://api.github.com/repos/paypal/squbs/deployments","created_at":"2015-07-07T20:48:12Z","updated_at":"2016-12-18T01:19:09Z","pushed_at":"2016-12-19T20:14:50Z","git_url":"git://github.com/paypal/squbs.git","ssh_url":"git@github.com:paypal/squbs.git","clone_url":"https://github.com/paypal/squbs.git","svn_url":"https://github.com/paypal/squbs","homepage":"http://paypal.github.io/squbs","size":6619,"stargazers_count":760,"watchers_count":760,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":120,"mirror_url":null,"open_issues_count":46,"forks":120,"open_issues":46,"watchers":760,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paypal/squbs/pulls/360"},"html":{"href":"https://github.com/paypal/squbs/pull/360"},"issue":{"href":"https://api.github.com/repos/paypal/squbs/issues/360"},"comments":{"href":"https://api.github.com/repos/paypal/squbs/issues/360/comments"},"review_comments":{"href":"https://api.github.com/repos/paypal/squbs/pulls/360/comments"},"review_comment":{"href":"https://api.github.com/repos/paypal/squbs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paypal/squbs/pulls/360/commits"},"statuses":{"href":"https://api.github.com/repos/paypal/squbs/statuses/5ba4d72a1063af0535f4bedc065a5132f5952874"}}}}
{"actor":{"display_login":"codacy-bot"}}