File tree 1 file changed +7
-1
lines changed
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]
1037
1037
The result is a snippet named `request-cookies.adoc` and a snippet named `response-cookies.adoc`.
1038
1038
Each contains a table describing the cookies.
1039
1039
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.
1041
1047
1042
1048
1043
1049
You can’t perform that action at this time.
0 commit comments