Polish "Add support for documenting request and response cookies"

See gh-592
This commit is contained in:
Andy Wilkinson
2022-03-24 17:32:42 +00:00
parent f72a9f1067
commit d5522f5335
26 changed files with 480 additions and 309 deletions

View File

@@ -48,6 +48,7 @@ import org.springframework.util.StreamUtils;
* {@link FilterableRequestSpecification}.
*
* @author Andy Wilkinson
* @author Clyde Stubbs
*/
class RestAssuredRequestConverter implements RequestConverter<FilterableRequestSpecification> {

View File

@@ -53,10 +53,9 @@ class RestAssuredResponseConverter implements ResponseConverter<Response> {
return Collections.emptyList();
}
List<ResponseCookie> cookies = new ArrayList<>();
for (Map.Entry<String, String> servletCookie : response.getCookies().entrySet()) {
cookies.add(new ResponseCookie(servletCookie.getKey(), servletCookie.getValue()));
for (Map.Entry<String, String> cookie : response.getCookies().entrySet()) {
cookies.add(new ResponseCookie(cookie.getKey(), cookie.getValue()));
}
headers.remove(HttpHeaders.COOKIE);
return cookies;
}