Class CookieResultMatchers
java.lang.Object
org.springframework.test.web.servlet.result.CookieResultMatchers
Factory for response cookie assertions.
An instance of this class is typically accessed via
MockMvcResultMatchers.cookie().
- Since:
- 3.2
- Author:
- Rossen Stoyanchev, Thomas Bruyelle
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAssert a cookie's specified attribute.Assert a cookie's specified attribute with a HamcrestMatcher.Assert a cookie's comment.Assert a cookie's comment with a HamcrestMatcher.doesNotExist(String name) Assert a cookie does not exist.Assert a cookie's domain.Assert a cookie's domain with a HamcrestMatcher.Assert a cookie exists.Assert whether the cookie must be HTTP only.Assert a cookie's maxAge.Assert a cookie's maxAge with a HamcrestMatcher.partitioned(String name, boolean partitioned) Assert whether the cookie is partitioned.Assert a cookie's path.Assert a cookie's path with a HamcrestMatcher.Assert a cookie's SameSite attribute.Assert a cookie's SameSite attribute with a HamcrestMatcher.Assert whether the cookie must be sent over a secure protocol or not.Assert a cookie value.Assert a cookie value with the given HamcrestMatcher.Assert a cookie's version.Assert a cookie's version with a HamcrestMatcher.
- 
Constructor Details- 
CookieResultMatchersprotected CookieResultMatchers()Protected constructor. UseMockMvcResultMatchers.cookie().
 
- 
- 
Method Details- 
valueAssert a cookie value with the given HamcrestMatcher.
- 
valueAssert a cookie value.
- 
existsAssert a cookie exists. The existence check is irrespective of whether max age is 0 (i.e. expired).
- 
doesNotExistAssert a cookie does not exist. Note that the existence check is irrespective of whether max age is 0, i.e. expired.
- 
maxAgeAssert a cookie's maxAge with a HamcrestMatcher.
- 
maxAgeAssert a cookie's maxAge.
- 
pathAssert a cookie's path with a HamcrestMatcher.
- 
pathAssert a cookie's path.
- 
domainAssert a cookie's domain with a HamcrestMatcher.
- 
domainAssert a cookie's domain.
- 
sameSiteAssert a cookie's SameSite attribute with a HamcrestMatcher.- Since:
- 6.0.8
- See Also:
 
- 
sameSiteAssert a cookie's SameSite attribute.- Since:
- 6.0.8
- See Also:
 
- 
commentAssert a cookie's comment with a HamcrestMatcher.
- 
commentAssert a cookie's comment.
- 
versionAssert a cookie's version with a HamcrestMatcher.
- 
versionAssert a cookie's version.
- 
secureAssert whether the cookie must be sent over a secure protocol or not.
- 
httpOnlyAssert whether the cookie must be HTTP only.- Since:
- 4.3.9
 
- 
partitionedAssert whether the cookie is partitioned.- Since:
- 6.2
 
- 
attribute
- 
attributeAssert a cookie's specified attribute.- Parameters:
- cookieAttribute- the name of the Cookie attribute (case-insensitive)
- Since:
- 6.0.8
 
 
-