{"action":"created","comment":{"url":"https://api.github.com/repos/rackerlabs/repose/pulls/comments/59621112","id":59621112,"diff_hunk":"@@ -2003,5 +2013,137 @@ class HttpServletResponseWrapperTest extends FunSpec with BeforeAndAfter with Ma\n       mockResponse.isCommitted shouldBe true\n       wrappedResponse.isCommitted shouldBe true\n     }\n+\n+    it(\"should write the content-length header\") {\n+      val out = new ByteArrayServletOutputStream()\n+      val wrappedResponse = new HttpServletResponseWrapper(originalResponse, ResponseMode.PASSTHROUGH, ResponseMode.MUTABLE, out)\n+\n+      val body = \"foo\"\n+      wrappedResponse.getOutputStream.print(body)\n+\n+      wrappedResponse.commitToResponse()\n+\n+      originalResponse.getHeader(CommonHttpHeader.CONTENT_LENGTH.toString) shouldEqual \"3\"\n+    }\n+\n+    it(\"should mark the wrapped response as committed\") {\n+      val wrappedResponse = new HttpServletResponseWrapper(originalResponse, ResponseMode.PASSTHROUGH, ResponseMode.PASSTHROUGH)\n+\n+      wrappedResponse.commitToResponse()\n+\n+      wrappedResponse.isCommitted shouldBe true\n+    }\n+  }\n+\n+  describe(\"setStatus\") {\n+    it(\"should set the status code and message\") {\n+      val wrappedResponse = new HttpServletResponseWrapper(originalResponse, ResponseMode.PASSTHROUGH, ResponseMode.PASSTHROUGH)\n+\n+      wrappedResponse.setStatus(418, \"TEAPOT\")\n+\n+      wrappedResponse.getStatus shouldBe 418\n+      wrappedResponse.getMessage shouldEqual \"TEAPOT\"\n+    }\n+  }\n+\n+  describe(\"sendError\") {\n+    it(\"should set the status code and message\") {\n+      val wrappedResponse = new HttpServletResponseWrapper(originalResponse, ResponseMode.PASSTHROUGH, ResponseMode.PASSTHROUGH)\n+\n+      // A hack to make this test work -- the original response /should/ set the status when sendError is called, but\n+      // this mock doesn't. So I set it here. If sendError overwrites it like it should, great, if not, fine.\n+      originalResponse.setStatus(418)\n+\n+      wrappedResponse.sendError(418, \"TEAPOT\")\n+\n+      wrappedResponse.getStatus shouldBe 418\n+      wrappedResponse.getMessage shouldEqual \"TEAPOT\"\n+    }\n+\n+    it(\"should mark the wrapped as committed when given a single argument\") {\n+      val wrappedResponse = new HttpServletResponseWrapper(originalResponse, ResponseMode.PASSTHROUGH, ResponseMode.PASSTHROUGH)\n+\n+      wrappedResponse.sendError(418)\n+\n+      wrappedResponse.isCommitted shouldBe true\n+    }\n+\n+    it(\"should mark the wrapper as committed when given two arguments\") {\n+      val wrappedResponse = new HttpServletResponseWrapper(originalResponse, ResponseMode.PASSTHROUGH, ResponseMode.PASSTHROUGH)\n+\n+      wrappedResponse.sendError(418, \"TEAPOT\")\n+\n+      wrappedResponse.isCommitted shouldBe true\n+    }\n+\n+    it(\"should not commit the underlying response if not in a mutable header mode\") {\n+      val wrappedResponse = new HttpServletResponseWrapper(originalResponse, ResponseMode.PASSTHROUGH, ResponseMode.PASSTHROUGH)\n+\n+      wrappedResponse.sendError(418, \"TEAPOT\")\n+\n+      originalResponse.wasErrorSent() shouldBe true\n+    }\n+\n+    it(\"should not commit the underlying response if in a mutable header mode\") {\n+      val wrappedResponse = new HttpServletResponseWrapper(originalResponse, ResponseMode.MUTABLE, ResponseMode.PASSTHROUGH)\n+\n+      wrappedResponse.sendError(418, \"TEAPOT\")\n+\n+      originalResponse.wasErrorSent() shouldBe false\n+    }\n+\n+    it(\"should not commit the underlying response if not in a mutable body mode\") {","path":"repose-aggregator/commons/commons-utilities/src/test/scala/org/openrepose/commons/utils/servlet/http/HttpServletResponseWrapperTest.scala","position":142,"original_position":142,"commit_id":"b614fce6e45f5bded4f938e81e5bb80523cd186c","original_commit_id":"cb5376359cfb5ec979d924314d6f0689ca92d0db","user":{"login":"adrianjgeorge","id":997130,"avatar_url":"https://avatars.githubusercontent.com/u/997130?v=3","gravatar_id":"","url":"https://api.github.com/users/adrianjgeorge","html_url":"https://github.com/adrianjgeorge","followers_url":"https://api.github.com/users/adrianjgeorge/followers","following_url":"https://api.github.com/users/adrianjgeorge/following{/other_user}","gists_url":"https://api.github.com/users/adrianjgeorge/gists{/gist_id}","starred_url":"https://api.github.com/users/adrianjgeorge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrianjgeorge/subscriptions","organizations_url":"https://api.github.com/users/adrianjgeorge/orgs","repos_url":"https://api.github.com/users/adrianjgeorge/repos","events_url":"https://api.github.com/users/adrianjgeorge/events{/privacy}","received_events_url":"https://api.github.com/users/adrianjgeorge/received_events","type":"User","site_admin":false},"body":"same problem","created_at":"2016-04-13T20:39:32Z","updated_at":"2016-04-13T20:39:32Z","html_url":"https://github.com/rackerlabs/repose/pull/1514#discussion_r59621112","pull_request_url":"https://api.github.com/repos/rackerlabs/repose/pulls/1514","_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/repose/pulls/comments/59621112"},"html":{"href":"https://github.com/rackerlabs/repose/pull/1514#discussion_r59621112"},"pull_request":{"href":"https://api.github.com/repos/rackerlabs/repose/pulls/1514"}}},"pull_request":{"url":"https://api.github.com/repos/rackerlabs/repose/pulls/1514","id":66166955,"html_url":"https://github.com/rackerlabs/repose/pull/1514","diff_url":"https://github.com/rackerlabs/repose/pull/1514.diff","patch_url":"https://github.com/rackerlabs/repose/pull/1514.patch","issue_url":"https://api.github.com/repos/rackerlabs/repose/issues/1514","number":1514,"state":"open","locked":false,"title":"REP-1618 Removing Mutable Wrappers and Old Pattern","user":{"login":"dmnjohns","id":1923408,"avatar_url":"https://avatars.githubusercontent.com/u/1923408?v=3","gravatar_id":"","url":"https://api.github.com/users/dmnjohns","html_url":"https://github.com/dmnjohns","followers_url":"https://api.github.com/users/dmnjohns/followers","following_url":"https://api.github.com/users/dmnjohns/following{/other_user}","gists_url":"https://api.github.com/users/dmnjohns/gists{/gist_id}","starred_url":"https://api.github.com/users/dmnjohns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmnjohns/subscriptions","organizations_url":"https://api.github.com/users/dmnjohns/orgs","repos_url":"https://api.github.com/users/dmnjohns/repos","events_url":"https://api.github.com/users/dmnjohns/events{/privacy}","received_events_url":"https://api.github.com/users/dmnjohns/received_events","type":"User","site_admin":false},"body":"This branch is based off of 7b3129282b19d1bc50de5bb7fd621e91f7ec5b5d (Mario's infra-filter logging branch). Most of these commits will poof once that gets merged.\r\n\r\nCompilation and unit tests are passing now, but I imagine some things are still borked. I'll let the Jenkins job tell me what's up.\r\n\r\n","created_at":"2016-04-12T14:26:55Z","updated_at":"2016-04-13T20:39:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rackerlabs/repose/pulls/1514/commits","review_comments_url":"https://api.github.com/repos/rackerlabs/repose/pulls/1514/comments","review_comment_url":"https://api.github.com/repos/rackerlabs/repose/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rackerlabs/repose/issues/1514/comments","statuses_url":"https://api.github.com/repos/rackerlabs/repose/statuses/b614fce6e45f5bded4f938e81e5bb80523cd186c","head":{"label":"rackerlabs:REP-1618","ref":"REP-1618","sha":"b614fce6e45f5bded4f938e81e5bb80523cd186c","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":1981821,"name":"repose","full_name":"rackerlabs/repose","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/repose","description":"The powerful, programmable, API Middleware Platform","fork":false,"url":"https://api.github.com/repos/rackerlabs/repose","forks_url":"https://api.github.com/repos/rackerlabs/repose/forks","keys_url":"https://api.github.com/repos/rackerlabs/repose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/repose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/repose/teams","hooks_url":"https://api.github.com/repos/rackerlabs/repose/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/repose/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/repose/events","assignees_url":"https://api.github.com/repos/rackerlabs/repose/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/repose/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/repose/tags","blobs_url":"https://api.github.com/repos/rackerlabs/repose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/repose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/repose/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/repose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/repose/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/repose/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/repose/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/repose/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/repose/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/repose/subscription","commits_url":"https://api.github.com/repos/rackerlabs/repose/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/repose/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/repose/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/repose/issues/comments{/number}","contents_url":"https://api.github.com/repos/rackerlabs/repose/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/repose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/repose/merges","archive_url":"https://api.github.com/repos/rackerlabs/repose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/repose/downloads","issues_url":"https://api.github.com/repos/rackerlabs/repose/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/repose/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/repose/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/repose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/repose/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/repose/releases{/id}","deployments_url":"https://api.github.com/repos/rackerlabs/repose/deployments","created_at":"2011-07-01T04:39:34Z","updated_at":"2016-04-05T09:44:03Z","pushed_at":"2016-04-13T20:33:06Z","git_url":"git://github.com/rackerlabs/repose.git","ssh_url":"git@github.com:rackerlabs/repose.git","clone_url":"https://github.com/rackerlabs/repose.git","svn_url":"https://github.com/rackerlabs/repose","homepage":"http://www.openrepose.org/","size":84043,"stargazers_count":243,"watchers_count":243,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":67,"mirror_url":null,"open_issues_count":11,"forks":67,"open_issues":11,"watchers":243,"default_branch":"master"}},"base":{"label":"rackerlabs:repose-8-staging","ref":"repose-8-staging","sha":"45dbdcb6a33f1e74df1a60974ebe40e5b2cd2181","user":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":1981821,"name":"repose","full_name":"rackerlabs/repose","owner":{"login":"rackerlabs","id":84293,"avatar_url":"https://avatars.githubusercontent.com/u/84293?v=3","gravatar_id":"","url":"https://api.github.com/users/rackerlabs","html_url":"https://github.com/rackerlabs","followers_url":"https://api.github.com/users/rackerlabs/followers","following_url":"https://api.github.com/users/rackerlabs/following{/other_user}","gists_url":"https://api.github.com/users/rackerlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/rackerlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rackerlabs/subscriptions","organizations_url":"https://api.github.com/users/rackerlabs/orgs","repos_url":"https://api.github.com/users/rackerlabs/repos","events_url":"https://api.github.com/users/rackerlabs/events{/privacy}","received_events_url":"https://api.github.com/users/rackerlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rackerlabs/repose","description":"The powerful, programmable, API Middleware Platform","fork":false,"url":"https://api.github.com/repos/rackerlabs/repose","forks_url":"https://api.github.com/repos/rackerlabs/repose/forks","keys_url":"https://api.github.com/repos/rackerlabs/repose/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rackerlabs/repose/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rackerlabs/repose/teams","hooks_url":"https://api.github.com/repos/rackerlabs/repose/hooks","issue_events_url":"https://api.github.com/repos/rackerlabs/repose/issues/events{/number}","events_url":"https://api.github.com/repos/rackerlabs/repose/events","assignees_url":"https://api.github.com/repos/rackerlabs/repose/assignees{/user}","branches_url":"https://api.github.com/repos/rackerlabs/repose/branches{/branch}","tags_url":"https://api.github.com/repos/rackerlabs/repose/tags","blobs_url":"https://api.github.com/repos/rackerlabs/repose/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rackerlabs/repose/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rackerlabs/repose/git/refs{/sha}","trees_url":"https://api.github.com/repos/rackerlabs/repose/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rackerlabs/repose/statuses/{sha}","languages_url":"https://api.github.com/repos/rackerlabs/repose/languages","stargazers_url":"https://api.github.com/repos/rackerlabs/repose/stargazers","contributors_url":"https://api.github.com/repos/rackerlabs/repose/contributors","subscribers_url":"https://api.github.com/repos/rackerlabs/repose/subscribers","subscription_url":"https://api.github.com/repos/rackerlabs/repose/subscription","commits_url":"https://api.github.com/repos/rackerlabs/repose/commits{/sha}","git_commits_url":"https://api.github.com/repos/rackerlabs/repose/git/commits{/sha}","comments_url":"https://api.github.com/repos/rackerlabs/repose/comments{/number}","issue_comment_url":"https://api.github.com/repos/rackerlabs/repose/issues/comments{/number}","contents_url":"https://api.github.com/repos/rackerlabs/repose/contents/{+path}","compare_url":"https://api.github.com/repos/rackerlabs/repose/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rackerlabs/repose/merges","archive_url":"https://api.github.com/repos/rackerlabs/repose/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rackerlabs/repose/downloads","issues_url":"https://api.github.com/repos/rackerlabs/repose/issues{/number}","pulls_url":"https://api.github.com/repos/rackerlabs/repose/pulls{/number}","milestones_url":"https://api.github.com/repos/rackerlabs/repose/milestones{/number}","notifications_url":"https://api.github.com/repos/rackerlabs/repose/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rackerlabs/repose/labels{/name}","releases_url":"https://api.github.com/repos/rackerlabs/repose/releases{/id}","deployments_url":"https://api.github.com/repos/rackerlabs/repose/deployments","created_at":"2011-07-01T04:39:34Z","updated_at":"2016-04-05T09:44:03Z","pushed_at":"2016-04-13T20:33:06Z","git_url":"git://github.com/rackerlabs/repose.git","ssh_url":"git@github.com:rackerlabs/repose.git","clone_url":"https://github.com/rackerlabs/repose.git","svn_url":"https://github.com/rackerlabs/repose","homepage":"http://www.openrepose.org/","size":84043,"stargazers_count":243,"watchers_count":243,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":67,"mirror_url":null,"open_issues_count":11,"forks":67,"open_issues":11,"watchers":243,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rackerlabs/repose/pulls/1514"},"html":{"href":"https://github.com/rackerlabs/repose/pull/1514"},"issue":{"href":"https://api.github.com/repos/rackerlabs/repose/issues/1514"},"comments":{"href":"https://api.github.com/repos/rackerlabs/repose/issues/1514/comments"},"review_comments":{"href":"https://api.github.com/repos/rackerlabs/repose/pulls/1514/comments"},"review_comment":{"href":"https://api.github.com/repos/rackerlabs/repose/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rackerlabs/repose/pulls/1514/commits"},"statuses":{"href":"https://api.github.com/repos/rackerlabs/repose/statuses/b614fce6e45f5bded4f938e81e5bb80523cd186c"}}}}