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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionAssert 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
.Assert a cookie's path.Assert a cookie's path 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
-
CookieResultMatchers
protected CookieResultMatchers()Protected constructor. UseMockMvcResultMatchers.cookie()
.
-
-
Method Details
-
value
Assert a cookie value with the given HamcrestMatcher
. -
value
Assert a cookie value. -
exists
Assert a cookie exists. The existence check is irrespective of whether max age is 0 (i.e. expired). -
doesNotExist
Assert a cookie does not exist. Note that the existence check is irrespective of whether max age is 0, i.e. expired. -
maxAge
Assert a cookie's maxAge with a HamcrestMatcher
. -
maxAge
Assert a cookie's maxAge. -
path
Assert a cookie's path with a HamcrestMatcher
. -
path
Assert a cookie's path. -
domain
Assert a cookie's domain with a HamcrestMatcher
. -
domain
Assert a cookie's domain. -
comment
Assert a cookie's comment with a HamcrestMatcher
. -
comment
Assert a cookie's comment. -
version
Assert a cookie's version with a HamcrestMatcher
. -
version
Assert a cookie's version. -
secure
Assert whether the cookie must be sent over a secure protocol or not. -
httpOnly
Assert whether the cookie must be HTTP only.- Since:
- 4.3.9
-