{"action":"created","comment":{"url":"https://api.github.com/repos/yegor256/takes/pulls/comments/26632827","id":26632827,"diff_hunk":"@@ -0,0 +1,95 @@\n+/**\n+ * The MIT License (MIT)\n+ *\n+ * Copyright (c) 2015 Yegor Bugayenko\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included\n+ * in all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+ * SOFTWARE.\n+ */\n+package org.takes.tk;\n+\n+import com.google.common.base.Joiner;\n+import java.io.IOException;\n+import java.net.HttpURLConnection;\n+import org.hamcrest.MatcherAssert;\n+import org.hamcrest.Matchers;\n+import org.junit.Test;\n+import org.takes.rs.RsPrint;\n+\n+/**\n+ * Test case for {@link TkRedirect}.\n+ * @author Dmitry Molotchko (dima.molotchko@gmail.com)\n+ * @version $Id$\n+ * @since 0.9.1\n+ */\n+public final class TkRedirectTest {\n+    /**\n+     * Constant variable for HTTP header testing.\n+     */\n+    private static final String LOCATION = \"Location: \";\n+    /**\n+     * New line constant.\n+     */\n+    private static final String NEWLINE = \"\\r\\n\";\n+\n+    /**\n+     * TkRedirect can create a response with url string.\n+     * @throws IOException If some problem inside\n+     */\n+    @Test\n+    public void createsRedirectResponseWithURL() throws IOException {\n+        final String url = \"/about\";\n+        MatcherAssert.assertThat(\n+            new RsPrint(\n+                new TkRedirect(url).act()\n+            ).print(),\n+            Matchers.equalTo(\n+                Joiner.on(NEWLINE).join(","path":"src/test/java/org/takes/tk/TkRedirectTest.java","position":62,"original_position":62,"commit_id":"931d9a6f58b027b182bc5df533a76d329e07d63f","original_commit_id":"931d9a6f58b027b182bc5df533a76d329e07d63f","user":{"login":"pinaf","id":1054771,"avatar_url":"https://avatars.githubusercontent.com/u/1054771?v=3","gravatar_id":"","url":"https://api.github.com/users/pinaf","html_url":"https://github.com/pinaf","followers_url":"https://api.github.com/users/pinaf/followers","following_url":"https://api.github.com/users/pinaf/following{/other_user}","gists_url":"https://api.github.com/users/pinaf/gists{/gist_id}","starred_url":"https://api.github.com/users/pinaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pinaf/subscriptions","organizations_url":"https://api.github.com/users/pinaf/orgs","repos_url":"https://api.github.com/users/pinaf/repos","events_url":"https://api.github.com/users/pinaf/events{/privacy}","received_events_url":"https://api.github.com/users/pinaf/received_events","type":"User","site_admin":false},"body":"@d-molotchko reference the static variable with the full path: `TkRedirectTest.NEWLINE`","created_at":"2015-03-18T01:46:27Z","updated_at":"2015-03-18T01:46:27Z","html_url":"https://github.com/yegor256/takes/pull/65#discussion_r26632827","pull_request_url":"https://api.github.com/repos/yegor256/takes/pulls/65","_links":{"self":{"href":"https://api.github.com/repos/yegor256/takes/pulls/comments/26632827"},"html":{"href":"https://github.com/yegor256/takes/pull/65#discussion_r26632827"},"pull_request":{"href":"https://api.github.com/repos/yegor256/takes/pulls/65"}}},"pull_request":{"url":"https://api.github.com/repos/yegor256/takes/pulls/65","id":31339871,"html_url":"https://github.com/yegor256/takes/pull/65","diff_url":"https://github.com/yegor256/takes/pull/65.diff","patch_url":"https://github.com/yegor256/takes/pull/65.patch","issue_url":"https://api.github.com/repos/yegor256/takes/issues/65","number":65,"state":"open","locked":false,"title":"#52 added unit test for TkRedirect","user":{"login":"d-molotchko","id":3078115,"avatar_url":"https://avatars.githubusercontent.com/u/3078115?v=3","gravatar_id":"","url":"https://api.github.com/users/d-molotchko","html_url":"https://github.com/d-molotchko","followers_url":"https://api.github.com/users/d-molotchko/followers","following_url":"https://api.github.com/users/d-molotchko/following{/other_user}","gists_url":"https://api.github.com/users/d-molotchko/gists{/gist_id}","starred_url":"https://api.github.com/users/d-molotchko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d-molotchko/subscriptions","organizations_url":"https://api.github.com/users/d-molotchko/orgs","repos_url":"https://api.github.com/users/d-molotchko/repos","events_url":"https://api.github.com/users/d-molotchko/events{/privacy}","received_events_url":"https://api.github.com/users/d-molotchko/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-17T14:31:16Z","updated_at":"2015-03-18T01:46:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36c01a85771662e208d6f3887e5e1eea3a8c377b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yegor256/takes/pulls/65/commits","review_comments_url":"https://api.github.com/repos/yegor256/takes/pulls/65/comments","review_comment_url":"https://api.github.com/repos/yegor256/takes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yegor256/takes/issues/65/comments","statuses_url":"https://api.github.com/repos/yegor256/takes/statuses/931d9a6f58b027b182bc5df533a76d329e07d63f","head":{"label":"d-molotchko:52","ref":"52","sha":"931d9a6f58b027b182bc5df533a76d329e07d63f","user":{"login":"d-molotchko","id":3078115,"avatar_url":"https://avatars.githubusercontent.com/u/3078115?v=3","gravatar_id":"","url":"https://api.github.com/users/d-molotchko","html_url":"https://github.com/d-molotchko","followers_url":"https://api.github.com/users/d-molotchko/followers","following_url":"https://api.github.com/users/d-molotchko/following{/other_user}","gists_url":"https://api.github.com/users/d-molotchko/gists{/gist_id}","starred_url":"https://api.github.com/users/d-molotchko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d-molotchko/subscriptions","organizations_url":"https://api.github.com/users/d-molotchko/orgs","repos_url":"https://api.github.com/users/d-molotchko/repos","events_url":"https://api.github.com/users/d-molotchko/events{/privacy}","received_events_url":"https://api.github.com/users/d-molotchko/received_events","type":"User","site_admin":false},"repo":{"id":32307539,"name":"takes","full_name":"d-molotchko/takes","owner":{"login":"d-molotchko","id":3078115,"avatar_url":"https://avatars.githubusercontent.com/u/3078115?v=3","gravatar_id":"","url":"https://api.github.com/users/d-molotchko","html_url":"https://github.com/d-molotchko","followers_url":"https://api.github.com/users/d-molotchko/followers","following_url":"https://api.github.com/users/d-molotchko/following{/other_user}","gists_url":"https://api.github.com/users/d-molotchko/gists{/gist_id}","starred_url":"https://api.github.com/users/d-molotchko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/d-molotchko/subscriptions","organizations_url":"https://api.github.com/users/d-molotchko/orgs","repos_url":"https://api.github.com/users/d-molotchko/repos","events_url":"https://api.github.com/users/d-molotchko/events{/privacy}","received_events_url":"https://api.github.com/users/d-molotchko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/d-molotchko/takes","description":"True Object-Oriented and Immutable Java Web Framework","fork":true,"url":"https://api.github.com/repos/d-molotchko/takes","forks_url":"https://api.github.com/repos/d-molotchko/takes/forks","keys_url":"https://api.github.com/repos/d-molotchko/takes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/d-molotchko/takes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/d-molotchko/takes/teams","hooks_url":"https://api.github.com/repos/d-molotchko/takes/hooks","issue_events_url":"https://api.github.com/repos/d-molotchko/takes/issues/events{/number}","events_url":"https://api.github.com/repos/d-molotchko/takes/events","assignees_url":"https://api.github.com/repos/d-molotchko/takes/assignees{/user}","branches_url":"https://api.github.com/repos/d-molotchko/takes/branches{/branch}","tags_url":"https://api.github.com/repos/d-molotchko/takes/tags","blobs_url":"https://api.github.com/repos/d-molotchko/takes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/d-molotchko/takes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/d-molotchko/takes/git/refs{/sha}","trees_url":"https://api.github.com/repos/d-molotchko/takes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/d-molotchko/takes/statuses/{sha}","languages_url":"https://api.github.com/repos/d-molotchko/takes/languages","stargazers_url":"https://api.github.com/repos/d-molotchko/takes/stargazers","contributors_url":"https://api.github.com/repos/d-molotchko/takes/contributors","subscribers_url":"https://api.github.com/repos/d-molotchko/takes/subscribers","subscription_url":"https://api.github.com/repos/d-molotchko/takes/subscription","commits_url":"https://api.github.com/repos/d-molotchko/takes/commits{/sha}","git_commits_url":"https://api.github.com/repos/d-molotchko/takes/git/commits{/sha}","comments_url":"https://api.github.com/repos/d-molotchko/takes/comments{/number}","issue_comment_url":"https://api.github.com/repos/d-molotchko/takes/issues/comments{/number}","contents_url":"https://api.github.com/repos/d-molotchko/takes/contents/{+path}","compare_url":"https://api.github.com/repos/d-molotchko/takes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/d-molotchko/takes/merges","archive_url":"https://api.github.com/repos/d-molotchko/takes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/d-molotchko/takes/downloads","issues_url":"https://api.github.com/repos/d-molotchko/takes/issues{/number}","pulls_url":"https://api.github.com/repos/d-molotchko/takes/pulls{/number}","milestones_url":"https://api.github.com/repos/d-molotchko/takes/milestones{/number}","notifications_url":"https://api.github.com/repos/d-molotchko/takes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/d-molotchko/takes/labels{/name}","releases_url":"https://api.github.com/repos/d-molotchko/takes/releases{/id}","created_at":"2015-03-16T07:11:02Z","updated_at":"2015-03-17T13:17:02Z","pushed_at":"2015-03-17T19:06:04Z","git_url":"git://github.com/d-molotchko/takes.git","ssh_url":"git@github.com:d-molotchko/takes.git","clone_url":"https://github.com/d-molotchko/takes.git","svn_url":"https://github.com/d-molotchko/takes","homepage":"http://www.takes.org","size":6040,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"yegor256:master","ref":"master","sha":"4fac29832ede8350e712ce551d4e3a7e152b0866","user":{"login":"yegor256","id":526301,"avatar_url":"https://avatars.githubusercontent.com/u/526301?v=3","gravatar_id":"","url":"https://api.github.com/users/yegor256","html_url":"https://github.com/yegor256","followers_url":"https://api.github.com/users/yegor256/followers","following_url":"https://api.github.com/users/yegor256/following{/other_user}","gists_url":"https://api.github.com/users/yegor256/gists{/gist_id}","starred_url":"https://api.github.com/users/yegor256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yegor256/subscriptions","organizations_url":"https://api.github.com/users/yegor256/orgs","repos_url":"https://api.github.com/users/yegor256/repos","events_url":"https://api.github.com/users/yegor256/events{/privacy}","received_events_url":"https://api.github.com/users/yegor256/received_events","type":"User","site_admin":false},"repo":{"id":28924109,"name":"takes","full_name":"yegor256/takes","owner":{"login":"yegor256","id":526301,"avatar_url":"https://avatars.githubusercontent.com/u/526301?v=3","gravatar_id":"","url":"https://api.github.com/users/yegor256","html_url":"https://github.com/yegor256","followers_url":"https://api.github.com/users/yegor256/followers","following_url":"https://api.github.com/users/yegor256/following{/other_user}","gists_url":"https://api.github.com/users/yegor256/gists{/gist_id}","starred_url":"https://api.github.com/users/yegor256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yegor256/subscriptions","organizations_url":"https://api.github.com/users/yegor256/orgs","repos_url":"https://api.github.com/users/yegor256/repos","events_url":"https://api.github.com/users/yegor256/events{/privacy}","received_events_url":"https://api.github.com/users/yegor256/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yegor256/takes","description":"True Object-Oriented and Immutable Java Web Framework","fork":false,"url":"https://api.github.com/repos/yegor256/takes","forks_url":"https://api.github.com/repos/yegor256/takes/forks","keys_url":"https://api.github.com/repos/yegor256/takes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yegor256/takes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yegor256/takes/teams","hooks_url":"https://api.github.com/repos/yegor256/takes/hooks","issue_events_url":"https://api.github.com/repos/yegor256/takes/issues/events{/number}","events_url":"https://api.github.com/repos/yegor256/takes/events","assignees_url":"https://api.github.com/repos/yegor256/takes/assignees{/user}","branches_url":"https://api.github.com/repos/yegor256/takes/branches{/branch}","tags_url":"https://api.github.com/repos/yegor256/takes/tags","blobs_url":"https://api.github.com/repos/yegor256/takes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yegor256/takes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yegor256/takes/git/refs{/sha}","trees_url":"https://api.github.com/repos/yegor256/takes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yegor256/takes/statuses/{sha}","languages_url":"https://api.github.com/repos/yegor256/takes/languages","stargazers_url":"https://api.github.com/repos/yegor256/takes/stargazers","contributors_url":"https://api.github.com/repos/yegor256/takes/contributors","subscribers_url":"https://api.github.com/repos/yegor256/takes/subscribers","subscription_url":"https://api.github.com/repos/yegor256/takes/subscription","commits_url":"https://api.github.com/repos/yegor256/takes/commits{/sha}","git_commits_url":"https://api.github.com/repos/yegor256/takes/git/commits{/sha}","comments_url":"https://api.github.com/repos/yegor256/takes/comments{/number}","issue_comment_url":"https://api.github.com/repos/yegor256/takes/issues/comments{/number}","contents_url":"https://api.github.com/repos/yegor256/takes/contents/{+path}","compare_url":"https://api.github.com/repos/yegor256/takes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yegor256/takes/merges","archive_url":"https://api.github.com/repos/yegor256/takes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yegor256/takes/downloads","issues_url":"https://api.github.com/repos/yegor256/takes/issues{/number}","pulls_url":"https://api.github.com/repos/yegor256/takes/pulls{/number}","milestones_url":"https://api.github.com/repos/yegor256/takes/milestones{/number}","notifications_url":"https://api.github.com/repos/yegor256/takes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yegor256/takes/labels{/name}","releases_url":"https://api.github.com/repos/yegor256/takes/releases{/id}","created_at":"2015-01-07T16:57:47Z","updated_at":"2015-03-17T18:54:24Z","pushed_at":"2015-03-17T18:54:24Z","git_url":"git://github.com/yegor256/takes.git","ssh_url":"git@github.com:yegor256/takes.git","clone_url":"https://github.com/yegor256/takes.git","svn_url":"https://github.com/yegor256/takes","homepage":"http://www.takes.org","size":6040,"stargazers_count":17,"watchers_count":17,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":25,"forks":3,"open_issues":25,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yegor256/takes/pulls/65"},"html":{"href":"https://github.com/yegor256/takes/pull/65"},"issue":{"href":"https://api.github.com/repos/yegor256/takes/issues/65"},"comments":{"href":"https://api.github.com/repos/yegor256/takes/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/yegor256/takes/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/yegor256/takes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yegor256/takes/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/yegor256/takes/statuses/931d9a6f58b027b182bc5df533a76d329e07d63f"}}}}