{"action":"created","comment":{"url":"https://api.github.com/repos/Moya/Moya/pulls/comments/169955856","pull_request_review_id":98564860,"id":169955856,"diff_hunk":"@@ -409,8 +409,7 @@ final class MoyaProviderSpec: QuickSpec {\n             }\n \n             it(\"returns identical sample response\") {\n-                // TODO: Fix this failing test\n-                let response = HTTPURLResponse(url: URL(string: \"http://example.com\")!, mimeType: nil, expectedContentLength: 0, textEncodingName: nil)\n+                let response = HTTPURLResponse(url: URL(string: \"http://example.com\")!, statusCode: 200, httpVersion: nil, headerFields: nil)!","path":"Tests/MoyaProviderSpec.swift","position":null,"original_position":6,"commit_id":"d34a05ccd41687b96c15afe4f4bb954d0a775ede","original_commit_id":"d34a05ccd41687b96c15afe4f4bb954d0a775ede","user":{"login":"SD10","id":7445580,"avatar_url":"https://avatars0.githubusercontent.com/u/7445580?v=4","gravatar_id":"","url":"https://api.github.com/users/SD10","html_url":"https://github.com/SD10","followers_url":"https://api.github.com/users/SD10/followers","following_url":"https://api.github.com/users/SD10/following{/other_user}","gists_url":"https://api.github.com/users/SD10/gists{/gist_id}","starred_url":"https://api.github.com/users/SD10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SD10/subscriptions","organizations_url":"https://api.github.com/users/SD10/orgs","repos_url":"https://api.github.com/users/SD10/repos","events_url":"https://api.github.com/users/SD10/events{/privacy}","received_events_url":"https://api.github.com/users/SD10/received_events","type":"User","site_admin":false},"body":"This is the change I discuss in the body of the issue above","created_at":"2018-02-22T13:35:30Z","updated_at":"2018-02-22T13:35:30Z","html_url":"https://github.com/Moya/Moya/pull/1593#discussion_r169955856","pull_request_url":"https://api.github.com/repos/Moya/Moya/pulls/1593","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Moya/Moya/pulls/comments/169955856"},"html":{"href":"https://github.com/Moya/Moya/pull/1593#discussion_r169955856"},"pull_request":{"href":"https://api.github.com/repos/Moya/Moya/pulls/1593"}}},"pull_request":{"url":"https://api.github.com/repos/Moya/Moya/pulls/1593","id":170751419,"html_url":"https://github.com/Moya/Moya/pull/1593","diff_url":"https://github.com/Moya/Moya/pull/1593.diff","patch_url":"https://github.com/Moya/Moya/pull/1593.patch","issue_url":"https://api.github.com/repos/Moya/Moya/issues/1593","number":1593,"state":"open","locked":false,"title":"Perform validation on stubbed responses","user":{"login":"SD10","id":7445580,"avatar_url":"https://avatars0.githubusercontent.com/u/7445580?v=4","gravatar_id":"","url":"https://api.github.com/users/SD10","html_url":"https://github.com/SD10","followers_url":"https://api.github.com/users/SD10/followers","following_url":"https://api.github.com/users/SD10/following{/other_user}","gists_url":"https://api.github.com/users/SD10/gists{/gist_id}","starred_url":"https://api.github.com/users/SD10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SD10/subscriptions","organizations_url":"https://api.github.com/users/SD10/orgs","repos_url":"https://api.github.com/users/SD10/repos","events_url":"https://api.github.com/users/SD10/events{/privacy}","received_events_url":"https://api.github.com/users/SD10/received_events","type":"User","site_admin":false},"body":"Resolves #1592 \r\n\r\nThis adds the ability to validate a stubbed response.\r\n\r\n#### Something to consider:\r\nThe `EndpointSampleResponse` has a case `.response(HTTPURLResponse, Data)`. \r\n\r\nWe have a unit test for this where we use the `URLResponse` initializer to create the `HTTPURLResponse`.\r\n\r\nYou can see the two initializers below:\r\n```Swift\r\n// HTTPURLResponse initializer\r\npublic init?(url: URL, statusCode: Int, httpVersion HTTPVersion: String?, headerFields: [String: String]?)\r\n\r\n// URLResponse initializer\r\npublic init(url: URL, mimeType MIMEType: String?, expectedContentLength length: Int, textEncodingName name: String?)\r\n```\r\n \r\nThis change would require that you use the `HTTPURLResponse` initializer because that is the only way to set the `statusCode` property (it is `get-only`). The drawback, however, is arguments like `mimeType` are also `get-only`. \r\n\r\nHowever, both `HTTPURLResponse` and `URLResponse` are open, so you could get around this by subclassing to make a mock response. \r\n\r\nLooking for thoughts from @Moya/contributors ","created_at":"2018-02-22T13:34:51Z","updated_at":"2018-02-22T13:35:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3ace78b8d69a01b2f2afb493c2cd89b86c7adc9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Moya/Moya/pulls/1593/commits","review_comments_url":"https://api.github.com/repos/Moya/Moya/pulls/1593/comments","review_comment_url":"https://api.github.com/repos/Moya/Moya/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Moya/Moya/issues/1593/comments","statuses_url":"https://api.github.com/repos/Moya/Moya/statuses/d34a05ccd41687b96c15afe4f4bb954d0a775ede","head":{"label":"Moya:enhancement/stubbed-validation","ref":"enhancement/stubbed-validation","sha":"d34a05ccd41687b96c15afe4f4bb954d0a775ede","user":{"login":"Moya","id":13662162,"avatar_url":"https://avatars3.githubusercontent.com/u/13662162?v=4","gravatar_id":"","url":"https://api.github.com/users/Moya","html_url":"https://github.com/Moya","followers_url":"https://api.github.com/users/Moya/followers","following_url":"https://api.github.com/users/Moya/following{/other_user}","gists_url":"https://api.github.com/users/Moya/gists{/gist_id}","starred_url":"https://api.github.com/users/Moya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Moya/subscriptions","organizations_url":"https://api.github.com/users/Moya/orgs","repos_url":"https://api.github.com/users/Moya/repos","events_url":"https://api.github.com/users/Moya/events{/privacy}","received_events_url":"https://api.github.com/users/Moya/received_events","type":"Organization","site_admin":false},"repo":{"id":23013268,"name":"Moya","full_name":"Moya/Moya","owner":{"login":"Moya","id":13662162,"avatar_url":"https://avatars3.githubusercontent.com/u/13662162?v=4","gravatar_id":"","url":"https://api.github.com/users/Moya","html_url":"https://github.com/Moya","followers_url":"https://api.github.com/users/Moya/followers","following_url":"https://api.github.com/users/Moya/following{/other_user}","gists_url":"https://api.github.com/users/Moya/gists{/gist_id}","starred_url":"https://api.github.com/users/Moya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Moya/subscriptions","organizations_url":"https://api.github.com/users/Moya/orgs","repos_url":"https://api.github.com/users/Moya/repos","events_url":"https://api.github.com/users/Moya/events{/privacy}","received_events_url":"https://api.github.com/users/Moya/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Moya/Moya","description":"Network abstraction layer written in Swift.","fork":false,"url":"https://api.github.com/repos/Moya/Moya","forks_url":"https://api.github.com/repos/Moya/Moya/forks","keys_url":"https://api.github.com/repos/Moya/Moya/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Moya/Moya/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Moya/Moya/teams","hooks_url":"https://api.github.com/repos/Moya/Moya/hooks","issue_events_url":"https://api.github.com/repos/Moya/Moya/issues/events{/number}","events_url":"https://api.github.com/repos/Moya/Moya/events","assignees_url":"https://api.github.com/repos/Moya/Moya/assignees{/user}","branches_url":"https://api.github.com/repos/Moya/Moya/branches{/branch}","tags_url":"https://api.github.com/repos/Moya/Moya/tags","blobs_url":"https://api.github.com/repos/Moya/Moya/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Moya/Moya/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Moya/Moya/git/refs{/sha}","trees_url":"https://api.github.com/repos/Moya/Moya/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Moya/Moya/statuses/{sha}","languages_url":"https://api.github.com/repos/Moya/Moya/languages","stargazers_url":"https://api.github.com/repos/Moya/Moya/stargazers","contributors_url":"https://api.github.com/repos/Moya/Moya/contributors","subscribers_url":"https://api.github.com/repos/Moya/Moya/subscribers","subscription_url":"https://api.github.com/repos/Moya/Moya/subscription","commits_url":"https://api.github.com/repos/Moya/Moya/commits{/sha}","git_commits_url":"https://api.github.com/repos/Moya/Moya/git/commits{/sha}","comments_url":"https://api.github.com/repos/Moya/Moya/comments{/number}","issue_comment_url":"https://api.github.com/repos/Moya/Moya/issues/comments{/number}","contents_url":"https://api.github.com/repos/Moya/Moya/contents/{+path}","compare_url":"https://api.github.com/repos/Moya/Moya/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Moya/Moya/merges","archive_url":"https://api.github.com/repos/Moya/Moya/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Moya/Moya/downloads","issues_url":"https://api.github.com/repos/Moya/Moya/issues{/number}","pulls_url":"https://api.github.com/repos/Moya/Moya/pulls{/number}","milestones_url":"https://api.github.com/repos/Moya/Moya/milestones{/number}","notifications_url":"https://api.github.com/repos/Moya/Moya/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Moya/Moya/labels{/name}","releases_url":"https://api.github.com/repos/Moya/Moya/releases{/id}","deployments_url":"https://api.github.com/repos/Moya/Moya/deployments","created_at":"2014-08-16T07:41:21Z","updated_at":"2018-02-22T11:02:42Z","pushed_at":"2018-02-22T13:34:52Z","git_url":"git://github.com/Moya/Moya.git","ssh_url":"git@github.com:Moya/Moya.git","clone_url":"https://github.com/Moya/Moya.git","svn_url":"https://github.com/Moya/Moya","homepage":"https://moya.github.io","size":16693,"stargazers_count":8180,"watchers_count":8180,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":981,"mirror_url":null,"archived":false,"open_issues_count":51,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":981,"open_issues":51,"watchers":8180,"default_branch":"master"}},"base":{"label":"Moya:master","ref":"master","sha":"77cd637031fdbdf217eee7b5196d80a07e6f5e74","user":{"login":"Moya","id":13662162,"avatar_url":"https://avatars3.githubusercontent.com/u/13662162?v=4","gravatar_id":"","url":"https://api.github.com/users/Moya","html_url":"https://github.com/Moya","followers_url":"https://api.github.com/users/Moya/followers","following_url":"https://api.github.com/users/Moya/following{/other_user}","gists_url":"https://api.github.com/users/Moya/gists{/gist_id}","starred_url":"https://api.github.com/users/Moya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Moya/subscriptions","organizations_url":"https://api.github.com/users/Moya/orgs","repos_url":"https://api.github.com/users/Moya/repos","events_url":"https://api.github.com/users/Moya/events{/privacy}","received_events_url":"https://api.github.com/users/Moya/received_events","type":"Organization","site_admin":false},"repo":{"id":23013268,"name":"Moya","full_name":"Moya/Moya","owner":{"login":"Moya","id":13662162,"avatar_url":"https://avatars3.githubusercontent.com/u/13662162?v=4","gravatar_id":"","url":"https://api.github.com/users/Moya","html_url":"https://github.com/Moya","followers_url":"https://api.github.com/users/Moya/followers","following_url":"https://api.github.com/users/Moya/following{/other_user}","gists_url":"https://api.github.com/users/Moya/gists{/gist_id}","starred_url":"https://api.github.com/users/Moya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Moya/subscriptions","organizations_url":"https://api.github.com/users/Moya/orgs","repos_url":"https://api.github.com/users/Moya/repos","events_url":"https://api.github.com/users/Moya/events{/privacy}","received_events_url":"https://api.github.com/users/Moya/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Moya/Moya","description":"Network abstraction layer written in Swift.","fork":false,"url":"https://api.github.com/repos/Moya/Moya","forks_url":"https://api.github.com/repos/Moya/Moya/forks","keys_url":"https://api.github.com/repos/Moya/Moya/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Moya/Moya/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Moya/Moya/teams","hooks_url":"https://api.github.com/repos/Moya/Moya/hooks","issue_events_url":"https://api.github.com/repos/Moya/Moya/issues/events{/number}","events_url":"https://api.github.com/repos/Moya/Moya/events","assignees_url":"https://api.github.com/repos/Moya/Moya/assignees{/user}","branches_url":"https://api.github.com/repos/Moya/Moya/branches{/branch}","tags_url":"https://api.github.com/repos/Moya/Moya/tags","blobs_url":"https://api.github.com/repos/Moya/Moya/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Moya/Moya/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Moya/Moya/git/refs{/sha}","trees_url":"https://api.github.com/repos/Moya/Moya/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Moya/Moya/statuses/{sha}","languages_url":"https://api.github.com/repos/Moya/Moya/languages","stargazers_url":"https://api.github.com/repos/Moya/Moya/stargazers","contributors_url":"https://api.github.com/repos/Moya/Moya/contributors","subscribers_url":"https://api.github.com/repos/Moya/Moya/subscribers","subscription_url":"https://api.github.com/repos/Moya/Moya/subscription","commits_url":"https://api.github.com/repos/Moya/Moya/commits{/sha}","git_commits_url":"https://api.github.com/repos/Moya/Moya/git/commits{/sha}","comments_url":"https://api.github.com/repos/Moya/Moya/comments{/number}","issue_comment_url":"https://api.github.com/repos/Moya/Moya/issues/comments{/number}","contents_url":"https://api.github.com/repos/Moya/Moya/contents/{+path}","compare_url":"https://api.github.com/repos/Moya/Moya/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Moya/Moya/merges","archive_url":"https://api.github.com/repos/Moya/Moya/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Moya/Moya/downloads","issues_url":"https://api.github.com/repos/Moya/Moya/issues{/number}","pulls_url":"https://api.github.com/repos/Moya/Moya/pulls{/number}","milestones_url":"https://api.github.com/repos/Moya/Moya/milestones{/number}","notifications_url":"https://api.github.com/repos/Moya/Moya/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Moya/Moya/labels{/name}","releases_url":"https://api.github.com/repos/Moya/Moya/releases{/id}","deployments_url":"https://api.github.com/repos/Moya/Moya/deployments","created_at":"2014-08-16T07:41:21Z","updated_at":"2018-02-22T11:02:42Z","pushed_at":"2018-02-22T13:34:52Z","git_url":"git://github.com/Moya/Moya.git","ssh_url":"git@github.com:Moya/Moya.git","clone_url":"https://github.com/Moya/Moya.git","svn_url":"https://github.com/Moya/Moya","homepage":"https://moya.github.io","size":16693,"stargazers_count":8180,"watchers_count":8180,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":981,"mirror_url":null,"archived":false,"open_issues_count":51,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":981,"open_issues":51,"watchers":8180,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Moya/Moya/pulls/1593"},"html":{"href":"https://github.com/Moya/Moya/pull/1593"},"issue":{"href":"https://api.github.com/repos/Moya/Moya/issues/1593"},"comments":{"href":"https://api.github.com/repos/Moya/Moya/issues/1593/comments"},"review_comments":{"href":"https://api.github.com/repos/Moya/Moya/pulls/1593/comments"},"review_comment":{"href":"https://api.github.com/repos/Moya/Moya/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Moya/Moya/pulls/1593/commits"},"statuses":{"href":"https://api.github.com/repos/Moya/Moya/statuses/d34a05ccd41687b96c15afe4f4bb954d0a775ede"}},"author_association":"OWNER"}}
{"actor":{"display_login":"SD10"}}