类 CookieResultMatchers

java.lang.Object
cn.taketoday.test.web.servlet.result.CookieResultMatchers

public class CookieResultMatchers extends Object
Factory for response cookie assertions.

An instance of this class is typically accessed via MockMvcResultMatchers.cookie().

从以下版本开始:
4.0
作者:
Rossen Stoyanchev, Thomas Bruyelle, Harry Yang
  • 构造器详细资料

  • 方法详细资料

    • value

      public ResultMatcher value(String name, org.hamcrest.Matcher<? super String> matcher)
      Assert a cookie value with the given Hamcrest Matcher.
    • value

      public ResultMatcher value(String name, String expectedValue)
      Assert a cookie value.
    • exists

      public ResultMatcher exists(String name)
      Assert a cookie exists. The existence check is irrespective of whether max age is 0 (i.e. expired).
    • doesNotExist

      public ResultMatcher doesNotExist(String name)
      Assert a cookie does not exist. Note that the existence check is irrespective of whether max age is 0, i.e. expired.
    • maxAge

      public ResultMatcher maxAge(String name, org.hamcrest.Matcher<? super Duration> matcher)
      Assert a cookie's maxAge with a Hamcrest Matcher.
    • maxAge

      public ResultMatcher maxAge(String name, int maxAge)
      Assert a cookie's maxAge.
    • maxAge

      public ResultMatcher maxAge(String name, Duration maxAge)
      Assert a cookie's maxAge.
    • path

      public ResultMatcher path(String name, org.hamcrest.Matcher<? super String> matcher)
      Assert a cookie's path with a Hamcrest Matcher.
    • path

      public ResultMatcher path(String name, String path)
      Assert a cookie's path.
    • domain

      public ResultMatcher domain(String name, org.hamcrest.Matcher<? super String> matcher)
      Assert a cookie's domain with a Hamcrest Matcher.
    • domain

      public ResultMatcher domain(String name, String domain)
      Assert a cookie's domain.
    • sameSite

      public ResultMatcher sameSite(String name, org.hamcrest.Matcher<? super String> matcher)
      Assert a cookie's SameSite attribute with a Hamcrest Matcher.
    • sameSite

      public ResultMatcher sameSite(String name, String sameSite)
      Assert a cookie's SameSite attribute.
    • secure

      public ResultMatcher secure(String name, boolean secure)
      Assert whether the cookie must be sent over a secure protocol or not.
    • httpOnly

      public ResultMatcher httpOnly(String name, boolean httpOnly)
      Assert whether the cookie must be HTTP only.
    • getCookie

      private static cn.taketoday.http.ResponseCookie getCookie(MvcResult result, String cookieName)
    • getCookie

      @Nullable private static cn.taketoday.http.ResponseCookie getCookie(cn.taketoday.web.RequestContext context, String cookieName)