Class CookieAssertions
java.lang.Object
org.springframework.test.web.reactive.server.CookieAssertions
Assertions on cookies of the response.
- Since:
- 5.3
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorDescriptionCookieAssertions
(ExchangeResult exchangeResult, WebTestClient.ResponseSpec responseSpec) -
Method Summary
Modifier and TypeMethodDescriptiondoesNotExist
(String name) Expect that the cookie with the given name is not present.Assert a cookie's "Domain" attribute.Assert a cookie's "Domain" attribute with a HamcrestMatcher
.Expect that the cookie with the given name is present.Assert a cookie's "HttpOnly" attribute.Assert a cookie's "Max-Age" attribute.Assert a cookie's "Max-Age" attribute with a HamcrestMatcher
.partitioned
(String name, boolean expected) Assert a cookie's "Partitioned" attribute.Assert a cookie's "Path" attribute.Assert a cookie's "Path" attribute with a HamcrestMatcher
.Assert a cookie's "SameSite" attribute.Assert a cookie's "Secure" attribute.Consume the value of the response cookie with the given name.Assert the value of the response cookie with the given name with a HamcrestMatcher
.valueEquals
(String name, String value) Expect a response cookie with the given name to match the specified value.
-
Constructor Details
-
CookieAssertions
-
-
Method Details
-
valueEquals
Expect a response cookie with the given name to match the specified value. -
value
Assert the value of the response cookie with the given name with a HamcrestMatcher
. -
value
Consume the value of the response cookie with the given name. -
exists
Expect that the cookie with the given name is present. -
doesNotExist
Expect that the cookie with the given name is not present. -
maxAge
Assert a cookie's "Max-Age" attribute. -
maxAge
Assert a cookie's "Max-Age" attribute with a HamcrestMatcher
. -
path
Assert a cookie's "Path" attribute. -
path
Assert a cookie's "Path" attribute with a HamcrestMatcher
. -
domain
Assert a cookie's "Domain" attribute. -
domain
Assert a cookie's "Domain" attribute with a HamcrestMatcher
. -
secure
Assert a cookie's "Secure" attribute. -
httpOnly
Assert a cookie's "HttpOnly" attribute. -
partitioned
Assert a cookie's "Partitioned" attribute.- Since:
- 6.2
-
sameSite
Assert a cookie's "SameSite" attribute.
-