{"action":"created","issue":{"url":"https://api.github.com/repos/hpi-swa-teaching/RatPack2.0/issues/98","repository_url":"https://api.github.com/repos/hpi-swa-teaching/RatPack2.0","labels_url":"https://api.github.com/repos/hpi-swa-teaching/RatPack2.0/issues/98/labels{/name}","comments_url":"https://api.github.com/repos/hpi-swa-teaching/RatPack2.0/issues/98/comments","events_url":"https://api.github.com/repos/hpi-swa-teaching/RatPack2.0/issues/98/events","html_url":"https://github.com/hpi-swa-teaching/RatPack2.0/issues/98","id":329829515,"node_id":"MDU6SXNzdWUzMjk4Mjk1MTU=","number":98,"title":"MockRequest /Mock... never calls the writeOn method of HttpResponse [20]","user":{"login":"essal0815","id":28301364,"node_id":"MDQ6VXNlcjI4MzAxMzY0","avatar_url":"https://avatars3.githubusercontent.com/u/28301364?v=4","gravatar_id":"","url":"https://api.github.com/users/essal0815","html_url":"https://github.com/essal0815","followers_url":"https://api.github.com/users/essal0815/followers","following_url":"https://api.github.com/users/essal0815/following{/other_user}","gists_url":"https://api.github.com/users/essal0815/gists{/gist_id}","starred_url":"https://api.github.com/users/essal0815/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/essal0815/subscriptions","organizations_url":"https://api.github.com/users/essal0815/orgs","repos_url":"https://api.github.com/users/essal0815/repos","events_url":"https://api.github.com/users/essal0815/events{/privacy}","received_events_url":"https://api.github.com/users/essal0815/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-06-06T11:35:44Z","updated_at":"2018-06-11T09:29:12Z","closed_at":null,"author_association":"NONE","body":"The MockRequests don't cover the whole flow. Normal Requests handled from a HttpService call on the HttpResponse `writeOn:`. The Mocks don't.\r\n\r\nSo the error that Response Body was a string and not ReadStream wasn't recognised.\r\n\r\nWe shall adjust the Mock so he also calls the `writeOn:`"},"comment":{"url":"https://api.github.com/repos/hpi-swa-teaching/RatPack2.0/issues/comments/396180957","html_url":"https://github.com/hpi-swa-teaching/RatPack2.0/issues/98#issuecomment-396180957","issue_url":"https://api.github.com/repos/hpi-swa-teaching/RatPack2.0/issues/98","id":396180957,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NjE4MDk1Nw==","user":{"login":"He3lixxx","id":13838962,"node_id":"MDQ6VXNlcjEzODM4OTYy","avatar_url":"https://avatars0.githubusercontent.com/u/13838962?v=4","gravatar_id":"","url":"https://api.github.com/users/He3lixxx","html_url":"https://github.com/He3lixxx","followers_url":"https://api.github.com/users/He3lixxx/followers","following_url":"https://api.github.com/users/He3lixxx/following{/other_user}","gists_url":"https://api.github.com/users/He3lixxx/gists{/gist_id}","starred_url":"https://api.github.com/users/He3lixxx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/He3lixxx/subscriptions","organizations_url":"https://api.github.com/users/He3lixxx/orgs","repos_url":"https://api.github.com/users/He3lixxx/repos","events_url":"https://api.github.com/users/He3lixxx/events{/privacy}","received_events_url":"https://api.github.com/users/He3lixxx/received_events","type":"User","site_admin":false},"created_at":"2018-06-11T09:29:12Z","updated_at":"2018-06-11T09:29:12Z","author_association":"NONE","body":"> So I convert the body content each time to ReadStream before checking.\r\n(While writing I notice how inefficient it is always to convert before, the conversion would be totally fine in the false Branch...)\r\n\r\nDid you see the `readStream` method? it's a noop on a ReadStream and a conversion on a string, so exactly what you would want.\r\n\r\nAlso, I think we're talking about two different things here:\r\n- From the initial issue text, I was thinking this was about testing that the `response body` is a ReadStream. We can not practically test that since wrong code would usually be created by a user who adds a bad handler or bad middleware which sets the `response body` to a string. We don't have that code, so we can't test it. No Socket or Service or whatever Mock would be able to do that for us.\r\n- Your last post sounds like you want to add automatic conversion to our code (which could then be tested, obviously). In this case, a user can not break it anymore. We don't need to do any mocks for this though, we just write one handler that sets the body to a string and check that it's a ReadStream afterwards.\r\n\r\nIf we want the second, which I'd like more, we should adapt the inital post to reflect that."}}
{"actor":{"display_login":"He3lixxx"}}