File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1037,7 +1037,13 @@ include::{examples-dir}/com/example/restassured/HttpCookies.java[tags=cookies]
10371037The result is a snippet named `request-cookies.adoc` and a snippet named `response-cookies.adoc`.
10381038Each 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
You can’t perform that action at this time.
0 commit comments