{"action":"created","issue":{"url":"https://api.github.com/repos/serenity-bdd/serenity-core/issues/448","repository_url":"https://api.github.com/repos/serenity-bdd/serenity-core","labels_url":"https://api.github.com/repos/serenity-bdd/serenity-core/issues/448/labels{/name}","comments_url":"https://api.github.com/repos/serenity-bdd/serenity-core/issues/448/comments","events_url":"https://api.github.com/repos/serenity-bdd/serenity-core/issues/448/events","html_url":"https://github.com/serenity-bdd/serenity-core/issues/448","id":159900895,"number":448,"title":"Serenity + Rest Assured Integration: The \"restQuery\" in the report doesn't contain Response Body","user":{"login":"viktor-klymenko","id":8802945,"avatar_url":"https://avatars.githubusercontent.com/u/8802945?v=3","gravatar_id":"","url":"https://api.github.com/users/viktor-klymenko","html_url":"https://github.com/viktor-klymenko","followers_url":"https://api.github.com/users/viktor-klymenko/followers","following_url":"https://api.github.com/users/viktor-klymenko/following{/other_user}","gists_url":"https://api.github.com/users/viktor-klymenko/gists{/gist_id}","starred_url":"https://api.github.com/users/viktor-klymenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viktor-klymenko/subscriptions","organizations_url":"https://api.github.com/users/viktor-klymenko/orgs","repos_url":"https://api.github.com/users/viktor-klymenko/repos","events_url":"https://api.github.com/users/viktor-klymenko/events{/privacy}","received_events_url":"https://api.github.com/users/viktor-klymenko/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/serenity-bdd/serenity-core/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/serenity-bdd/serenity-core/labels/waiting%20for%20feedback","name":"waiting for feedback","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-06-13T08:50:58Z","updated_at":"2016-06-17T11:22:23Z","closed_at":null,"body":"Serenity + Rest Assured Integration: The \"restQuery\" in the report doesn't contain Response Body - the corresponding field in HTML report is empty. Actually, there are not such field in  \"restQuery\" element of corresponding json generated after test execution. \r\nThe request was sent using following code:\r\n```\r\ngiven()\r\n                .specification(requests.getRequest(parameter1, parameter2))\r\n                .body(data)\r\n                .log().all()\r\n                .post(\"server.php\");\r\n```\r\n\r\nThe **baseURI** is:\r\n`RestAssured.baseURI = \"http://www.angularjshub.com\";`\r\n\r\nThe **basePath** is:\r\n`.setDefaultBasePath(\"code/examples/servercalls/01_HTTPService/\")`\r\n\r\nMoreover, field \"responseCookies\" actually contains headers of response instead of cookies.\r\n\r\nVersions:\r\ncompile 'net.serenity-bdd:serenity-core:1.1.36'\r\ncompile 'net.serenity-bdd:serenity-rest-assured:1.1.36'"},"comment":{"url":"https://api.github.com/repos/serenity-bdd/serenity-core/issues/comments/226745099","html_url":"https://github.com/serenity-bdd/serenity-core/issues/448#issuecomment-226745099","issue_url":"https://api.github.com/repos/serenity-bdd/serenity-core/issues/448","id":226745099,"user":{"login":"viktor-klymenko","id":8802945,"avatar_url":"https://avatars.githubusercontent.com/u/8802945?v=3","gravatar_id":"","url":"https://api.github.com/users/viktor-klymenko","html_url":"https://github.com/viktor-klymenko","followers_url":"https://api.github.com/users/viktor-klymenko/followers","following_url":"https://api.github.com/users/viktor-klymenko/following{/other_user}","gists_url":"https://api.github.com/users/viktor-klymenko/gists{/gist_id}","starred_url":"https://api.github.com/users/viktor-klymenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viktor-klymenko/subscriptions","organizations_url":"https://api.github.com/users/viktor-klymenko/orgs","repos_url":"https://api.github.com/users/viktor-klymenko/repos","events_url":"https://api.github.com/users/viktor-klymenko/events{/privacy}","received_events_url":"https://api.github.com/users/viktor-klymenko/received_events","type":"User","site_admin":false},"created_at":"2016-06-17T11:22:23Z","updated_at":"2016-06-17T11:22:23Z","body":"About cookies and headers - this defect can be reproduce in case if there are no cookies in response. The problem in the following code snippet in net.serenitybdd.rest.utils.RestResponseRecordingHelper#print method:\r\n```\r\ntry (ByteArrayOutputStream output = new ByteArrayOutputStream();\r\n                 PrintStream recordingStream = new PrintStream(output, true, StandardCharsets.UTF_8.toString())) {\r\n                for (final LogDetail detail : logDetail) {\r\n                    try {\r\n                        ResponsePrinter.print(response, response.getBody(), recordingStream, detail, shouldPrettyPrint);\r\n                    } catch (NullPointerException e) {\r\n                        //can be thrown if some field like cookies or headers are empty\r\n                    }\r\n                    recordingStream.flush();\r\n                    String recorded = new String(output.toByteArray(), StandardCharsets.UTF_8);\r\n                    recorded = recorded.replaceAll(\"^(\" +\r\n                            \"(Proxy:)|(Body:)|(Cookies:)|(Headers:)|(Multiparts:)|(Request path:)\" +\r\n                            \")\\\\s*\\\\n*\", \"\");\r\n                    recorded = recorded.replaceAll(\"^(<none>)\", \"\");\r\n                    recorded = recorded.replaceAll(\"\\n$\", \"\");\r\n                    result.put(detail, recorded);\r\n\r\n                }\r\n```\r\nThe variable output is not cleared after first iteration of \"for\" loop and in case if there were no cookies in response the variable will not be modified in ResponsePrinter.print so the result item with name \"COOKIES\" will contain headers captured during previous interation"}}
{"actor":{"display_login":"viktor-klymenko"}}