{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/comments/159155746","pull_request_review_id":86062302,"id":159155746,"diff_hunk":"@@ -0,0 +1,77 @@\n+/*\n+ * Copyright 2015 Google Inc. All Rights Reserved.\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+\n+package com.google.cloud.storage;\n+\n+import static org.junit.Assert.assertEquals;\n+\n+import java.util.Collections;\n+import java.util.HashMap;\n+import java.util.Map;\n+import org.junit.Before;\n+import org.junit.Test;\n+\n+public class CanonicalExtensionHeadersSerializerTest {\n+\n+  private CanonicalExtensionHeadersSerializer serializer;\n+\n+  @Before\n+  public void setUp() {\n+    serializer = new CanonicalExtensionHeadersSerializer();\n+  }\n+  \n+  @Test\n+  public void given_no_headers_when_serialize_then_produce_empty_string() {\n+    \n+    StringBuilder sb = serializer.serialize(Collections.<String, String>emptyMap());\n+    \n+    assertEquals(sb.toString(), \"\");\n+  }\n+  \n+  @Test\n+  public void given_null_headers_when_serialize_then_produce_empty_string() {\n+    \n+    StringBuilder sb = serializer.serialize(null);\n+    \n+    assertEquals(sb.toString(), \"\");\n+  }\n+  \n+  @Test\n+  public void given_encryption_headers_when_serialize_then_are_remvoed() {","path":"google-cloud-storage/src/test/java/com/google/cloud/storage/CanonicalExtensionHeadersSerializerTest.java","position":53,"original_position":53,"commit_id":"fdf91c400651c0f9e9573771a67960730d902bdf","original_commit_id":"fdf91c400651c0f9e9573771a67960730d902bdf","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","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: [Method names should not contain underscores](https://www.codacy.com/app/mziccard/google-cloud-java/pullRequest?prid=901391)","created_at":"2018-01-01T13:23:32Z","updated_at":"2018-01-01T13:23:32Z","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/2422#discussion_r159155746","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/2422","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/comments/159155746"},"html":{"href":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/2422#discussion_r159155746"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/2422"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/2422","id":140212338,"html_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/2422","diff_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/2422.diff","patch_url":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/2422.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2422","number":2422,"state":"open","locked":false,"title":"Using extended headers with sign URL","user":{"login":"frantello","id":6098478,"avatar_url":"https://avatars0.githubusercontent.com/u/6098478?v=4","gravatar_id":"","url":"https://api.github.com/users/frantello","html_url":"https://github.com/frantello","followers_url":"https://api.github.com/users/frantello/followers","following_url":"https://api.github.com/users/frantello/following{/other_user}","gists_url":"https://api.github.com/users/frantello/gists{/gist_id}","starred_url":"https://api.github.com/users/frantello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frantello/subscriptions","organizations_url":"https://api.github.com/users/frantello/orgs","repos_url":"https://api.github.com/users/frantello/repos","events_url":"https://api.github.com/users/frantello/events{/privacy}","received_events_url":"https://api.github.com/users/frantello/received_events","type":"User","site_admin":false},"body":"Special features over sign URLs require extension headers.\r\n\r\nAdded headers must match specification about canonicalized extension headers.\r\n\r\nI discover that headers must be ordered before sign. Otherwise server never will match signatures.","created_at":"2017-09-10T15:09:13Z","updated_at":"2018-01-01T13:23:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f41648545d440ad64cb4e48c1f18283caddb6a2c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/2422/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/2422/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2422/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/statuses/fdf91c400651c0f9e9573771a67960730d902bdf","head":{"label":"frantello:master","ref":"master","sha":"fdf91c400651c0f9e9573771a67960730d902bdf","user":{"login":"frantello","id":6098478,"avatar_url":"https://avatars0.githubusercontent.com/u/6098478?v=4","gravatar_id":"","url":"https://api.github.com/users/frantello","html_url":"https://github.com/frantello","followers_url":"https://api.github.com/users/frantello/followers","following_url":"https://api.github.com/users/frantello/following{/other_user}","gists_url":"https://api.github.com/users/frantello/gists{/gist_id}","starred_url":"https://api.github.com/users/frantello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frantello/subscriptions","organizations_url":"https://api.github.com/users/frantello/orgs","repos_url":"https://api.github.com/users/frantello/repos","events_url":"https://api.github.com/users/frantello/events{/privacy}","received_events_url":"https://api.github.com/users/frantello/received_events","type":"User","site_admin":false},"repo":{"id":102948632,"name":"google-cloud-java","full_name":"frantello/google-cloud-java","owner":{"login":"frantello","id":6098478,"avatar_url":"https://avatars0.githubusercontent.com/u/6098478?v=4","gravatar_id":"","url":"https://api.github.com/users/frantello","html_url":"https://github.com/frantello","followers_url":"https://api.github.com/users/frantello/followers","following_url":"https://api.github.com/users/frantello/following{/other_user}","gists_url":"https://api.github.com/users/frantello/gists{/gist_id}","starred_url":"https://api.github.com/users/frantello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frantello/subscriptions","organizations_url":"https://api.github.com/users/frantello/orgs","repos_url":"https://api.github.com/users/frantello/repos","events_url":"https://api.github.com/users/frantello/events{/privacy}","received_events_url":"https://api.github.com/users/frantello/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/frantello/google-cloud-java","description":"Google Cloud Client Library for Java","fork":true,"url":"https://api.github.com/repos/frantello/google-cloud-java","forks_url":"https://api.github.com/repos/frantello/google-cloud-java/forks","keys_url":"https://api.github.com/repos/frantello/google-cloud-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frantello/google-cloud-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frantello/google-cloud-java/teams","hooks_url":"https://api.github.com/repos/frantello/google-cloud-java/hooks","issue_events_url":"https://api.github.com/repos/frantello/google-cloud-java/issues/events{/number}","events_url":"https://api.github.com/repos/frantello/google-cloud-java/events","assignees_url":"https://api.github.com/repos/frantello/google-cloud-java/assignees{/user}","branches_url":"https://api.github.com/repos/frantello/google-cloud-java/branches{/branch}","tags_url":"https://api.github.com/repos/frantello/google-cloud-java/tags","blobs_url":"https://api.github.com/repos/frantello/google-cloud-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frantello/google-cloud-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frantello/google-cloud-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/frantello/google-cloud-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frantello/google-cloud-java/statuses/{sha}","languages_url":"https://api.github.com/repos/frantello/google-cloud-java/languages","stargazers_url":"https://api.github.com/repos/frantello/google-cloud-java/stargazers","contributors_url":"https://api.github.com/repos/frantello/google-cloud-java/contributors","subscribers_url":"https://api.github.com/repos/frantello/google-cloud-java/subscribers","subscription_url":"https://api.github.com/repos/frantello/google-cloud-java/subscription","commits_url":"https://api.github.com/repos/frantello/google-cloud-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/frantello/google-cloud-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/frantello/google-cloud-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/frantello/google-cloud-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/frantello/google-cloud-java/contents/{+path}","compare_url":"https://api.github.com/repos/frantello/google-cloud-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frantello/google-cloud-java/merges","archive_url":"https://api.github.com/repos/frantello/google-cloud-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frantello/google-cloud-java/downloads","issues_url":"https://api.github.com/repos/frantello/google-cloud-java/issues{/number}","pulls_url":"https://api.github.com/repos/frantello/google-cloud-java/pulls{/number}","milestones_url":"https://api.github.com/repos/frantello/google-cloud-java/milestones{/number}","notifications_url":"https://api.github.com/repos/frantello/google-cloud-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frantello/google-cloud-java/labels{/name}","releases_url":"https://api.github.com/repos/frantello/google-cloud-java/releases{/id}","deployments_url":"https://api.github.com/repos/frantello/google-cloud-java/deployments","created_at":"2017-09-09T10:56:23Z","updated_at":"2017-09-09T10:56:32Z","pushed_at":"2018-01-01T13:17:22Z","git_url":"git://github.com/frantello/google-cloud-java.git","ssh_url":"git@github.com:frantello/google-cloud-java.git","clone_url":"https://github.com/frantello/google-cloud-java.git","svn_url":"https://github.com/frantello/google-cloud-java","homepage":"https://googlecloudplatform.github.io/google-cloud-java/","size":194913,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"GoogleCloudPlatform:master","ref":"master","sha":"e7732103a44c40e6379f9eb1eb0cb0cdcfa8bd47","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":26181278,"name":"google-cloud-java","full_name":"GoogleCloudPlatform/google-cloud-java","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars0.githubusercontent.com/u/2810941?v=4","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/google-cloud-java","description":"Google Cloud Client Library for Java","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/deployments","created_at":"2014-11-04T17:57:16Z","updated_at":"2018-01-01T04:44:02Z","pushed_at":"2018-01-01T13:17:25Z","git_url":"git://github.com/GoogleCloudPlatform/google-cloud-java.git","ssh_url":"git@github.com:GoogleCloudPlatform/google-cloud-java.git","clone_url":"https://github.com/GoogleCloudPlatform/google-cloud-java.git","svn_url":"https://github.com/GoogleCloudPlatform/google-cloud-java","homepage":"https://googlecloudplatform.github.io/google-cloud-java/","size":237146,"stargazers_count":517,"watchers_count":517,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":338,"mirror_url":null,"archived":false,"open_issues_count":180,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":338,"open_issues":180,"watchers":517,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/2422"},"html":{"href":"https://github.com/GoogleCloudPlatform/google-cloud-java/pull/2422"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2422"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/issues/2422/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/2422/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/pulls/2422/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-java/statuses/fdf91c400651c0f9e9573771a67960730d902bdf"}},"author_association":"NONE"}}
{"actor":{"display_login":"codacy-bot"}}