Skip to content

Commit c3a193c

Browse files
committedJul 18, 2022
Polish HTTP cookies documentation
See gh-592
1 parent 3a87d5f commit c3a193c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎docs/src/docs/asciidoc/documenting-your-api.adoc

+7-1
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,13 @@ include::{examples-dir}/com/example/restassured/HttpCookies.java[tags=cookies]
10371037
The result is a snippet named `request-cookies.adoc` and a snippet named `response-cookies.adoc`.
10381038
Each contains a table describing the cookies.
10391039

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

10421048

10431049

0 commit comments

Comments
 (0)
Please sign in to comment.