Class AbstractCookieAssertions<E,R>
java.lang.Object
org.springframework.test.web.support.AbstractCookieAssertions<E,R>
- Type Parameters:
E
- the type of the exchange resultR
- the type of the response spec
- Direct Known Subclasses:
CookieAssertions
,CookieAssertions
Assertions on cookies of the response.
- Since:
- 7.0
- Author:
- Rob Worsnop, Rossen Stoyanchev
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractCookieAssertions
(E exchangeResult, R responseSpec) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
assertWithDiagnostics
(Runnable assertion) Subclasses must implement this to assert with diagnostics.doesNotExist
(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.protected E
Return the exchange result.protected abstract MultiValueMap
<String, ResponseCookie> Subclasses must implement this to provide access to response cookies.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
-
AbstractCookieAssertions
-
-
Method Details
-
getExchangeResult
Return the exchange result. -
getResponseCookies
Subclasses must implement this to provide access to response cookies. -
assertWithDiagnostics
Subclasses must implement this to assert with diagnostics. -
valueEquals
-
value
-
value
-
exists
-
doesNotExist
-
maxAge
-
maxAge
-
path
-
path
-
domain
-
domain
-
secure
-
httpOnly
-
partitioned
-
sameSite
-