Skip to content

Commit

Permalink
Polish HTTP cookies documentation
Browse files Browse the repository at this point in the history
See gh-592
  • Loading branch information
wilkinsona committed Jul 18, 2022
1 parent 3a87d5f commit c3a193c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/src/docs/asciidoc/documenting-your-api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,13 @@ include::{examples-dir}/com/example/restassured/HttpCookies.java[tags=cookies]
The result is a snippet named `request-cookies.adoc` and a snippet named `response-cookies.adoc`.
Each contains a table describing the cookies.

When documenting HTTP Cookies, the test fails if a documented cookie is not found in the request or response.
When documenting HTTP cookies, the test fails if an undocumented cookie is found in the request or response.
Similarly, the test also fails if a documented cookie is not found and the cookie has not been marked as optional.
You can also document cookies in a relaxed mode, where any undocumented cookies do not cause a test failure.
To do so, use the `relaxedRequestCookies` and `relaxedResponseCookies` methods on `org.springframework.restdocs.cookies.CookieDocumentation`.
This can be useful when documenting a particular scenario where you only want to focus on a subset of the cookies.
If you do not want to document a cookie, you can mark it as ignored.
Doing so prevents it from appearing in the generated snippet while avoiding the failure described earlier.



Expand Down

0 comments on commit c3a193c

Please sign in to comment.