Class CookieMapAssert

java.lang.Object
org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
org.assertj.core.api.AbstractObjectAssert<SELF,ACTUAL>
org.assertj.core.api.AbstractMapAssert<CookieMapAssert,Map<String,Cookie>,String,Cookie>
org.springframework.test.web.servlet.assertj.CookieMapAssert
All Implemented Interfaces:
org.assertj.core.api.Assert<CookieMapAssert,Map<String,Cookie>>, org.assertj.core.api.Descriptable<CookieMapAssert>, org.assertj.core.api.EnumerableAssert<CookieMapAssert,Map.Entry<? extends String,? extends Cookie>>, org.assertj.core.api.ExtensionPoints<CookieMapAssert,Map<String,Cookie>>

public class CookieMapAssert extends org.assertj.core.api.AbstractMapAssert<CookieMapAssert,Map<String,Cookie>,String,Cookie>
AssertJ assertions that can be applied to cookies.
Since:
6.2
Author:
Brian Clozel, Stephane Nicoll
  • Field Summary

    Fields inherited from class org.assertj.core.api.AbstractAssert

    actual, info, myself, objects, throwUnsupportedExceptionOnEquals
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Verify that the actual cookies contain a cookie with the given name.
    Verify that the actual cookies contain cookies with the given names.
    Verify that the actual cookies do not contain a cookie with the given name.
    Verify that the actual cookies do not contain any cookies with the given names.
    hasCookieSatisfying(String name, Consumer<Cookie> cookieRequirements)
    Verify that the actual cookies contain a cookie with the given name that satisfies the given cookieRequirements.
    hasDomain(String name, String expected)
    Verify that the actual cookies contain a cookie with the given name whose domain is equal to the given one.
    hasMaxAge(String name, Duration expected)
    Verify that the actual cookies contain a cookie with the given name whose max age is equal to the given one.
    hasPath(String name, String expected)
    Verify that the actual cookies contain a cookie with the given name whose path is equal to the given one.
    hasValue(String name, String expected)
    Verify that the actual cookies contain a cookie with the given name whose value is equal to the given one.
    isHttpOnly(String name, boolean expected)
    Verify that the actual cookies contain a cookie with the given name whose http only flag is equal to the given one.
    isSecure(String name, boolean expected)
    Verify that the actual cookies contain a cookie with the given name whose secure flag is equal to the give one.

    Methods inherited from class org.assertj.core.api.AbstractMapAssert

    allSatisfy, anySatisfy, as, as, contains, containsAllEntriesOf, containsAnyOf, containsAnyOfForProxy, containsEntry, containsExactly, containsExactlyEntriesOf, containsExactlyForProxy, containsExactlyInAnyOrderEntriesOf, containsForProxy, containsKey, containsKeys, containsKeysForProxy, containsOnly, containsOnlyForProxy, containsOnlyKeys, containsOnlyKeys, containsOnlyKeysForProxy, containsValue, containsValues, containsValuesForProxy, describedAs, describedAs, doesNotContain, doesNotContainEntry, doesNotContainForProxy, doesNotContainKey, doesNotContainKeys, doesNotContainKeysForProxy, doesNotContainValue, doesNotHave, doesNotHaveSameClassAs, extracting, extracting, extractingByKey, extractingByKey, extractingByKeys, extractingByKeysForProxy, extractingFromEntries, extractingFromEntries, extractingFromEntriesForProxy, flatExtracting, has, hasEntrySatisfying, hasEntrySatisfying, hasEntrySatisfying, hasEntrySatisfying, hasKeySatisfying, hasSameClassAs, hasSameSizeAs, hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, hasToString, hasValueSatisfying, is, isEmpty, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEmpty, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNullOrEmpty, isOfAnyClassIn, isSameAs, isUnmodifiable, noneSatisfy, overridingErrorMessage, size, usingComparator, usingComparator, usingDefaultComparator, usingDefaultElementComparator, usingElementComparator, usingRecursiveAssertion, usingRecursiveAssertion, usingRecursiveComparison, usingRecursiveComparison, values, withFailMessage, withThreadDumpOnError

    Methods inherited from class org.assertj.core.api.AbstractObjectAssert

    doesNotReturn, extracting, extracting, extracting, extracting, extracting, extracting, extractingForProxy, getComparatorsByType, hasAllNullFieldsOrProperties, hasAllNullFieldsOrPropertiesExcept, hasFieldOrProperty, hasFieldOrPropertyWithValue, hasNoNullFieldsOrProperties, hasNoNullFieldsOrPropertiesExcept, hasOnlyFields, isEqualToComparingFieldByField, isEqualToComparingFieldByFieldRecursively, isEqualToComparingOnlyGivenFields, isEqualToIgnoringGivenFields, isEqualToIgnoringNullFields, newObjectAssert, returns, usingComparatorForFields, usingComparatorForType

    Methods inherited from class org.assertj.core.api.AbstractAssert

    areEqual, asInstanceOf, asList, assertionError, asString, descriptionText, doesNotHaveSameHashCodeAs, doesNotHaveToString, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, hashCode, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, isElementOfCustomAssert, isInstanceOfSatisfying, isNull, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, withFailMessage, withRepresentation

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.assertj.core.api.Descriptable

    as, describedAs
  • Constructor Details

    • CookieMapAssert

      public CookieMapAssert(Cookie[] actual)
  • Method Details

    • containsCookie

      public CookieMapAssert containsCookie(String name)
      Verify that the actual cookies contain a cookie with the given name.
      Parameters:
      name - the name of an expected cookie
      See Also:
      • AbstractMapAssert.containsKey(K)
    • containsCookies

      public CookieMapAssert containsCookies(String... names)
      Verify that the actual cookies contain cookies with the given names.
      Parameters:
      names - the names of expected cookies
      See Also:
      • AbstractMapAssert.containsKeys(K...)
    • doesNotContainCookie

      public CookieMapAssert doesNotContainCookie(String name)
      Verify that the actual cookies do not contain a cookie with the given name.
      Parameters:
      name - the name of a cookie that should not be present
      See Also:
      • AbstractMapAssert.doesNotContainKey(K)
    • doesNotContainCookies

      public CookieMapAssert doesNotContainCookies(String... names)
      Verify that the actual cookies do not contain any cookies with the given names.
      Parameters:
      names - the names of cookies that should not be present
      See Also:
      • AbstractMapAssert.doesNotContainKeys(K...)
    • hasCookieSatisfying

      public CookieMapAssert hasCookieSatisfying(String name, Consumer<Cookie> cookieRequirements)
      Verify that the actual cookies contain a cookie with the given name that satisfies the given cookieRequirements.
      Parameters:
      name - the name of an expected cookie
      cookieRequirements - the requirements for the cookie
    • hasValue

      public CookieMapAssert hasValue(String name, String expected)
      Verify that the actual cookies contain a cookie with the given name whose value is equal to the given one.
      Parameters:
      name - the name of the cookie
      expected - the expected value of the cookie
    • hasMaxAge

      public CookieMapAssert hasMaxAge(String name, Duration expected)
      Verify that the actual cookies contain a cookie with the given name whose max age is equal to the given one.
      Parameters:
      name - the name of the cookie
      expected - the expected max age of the cookie
    • hasPath

      public CookieMapAssert hasPath(String name, String expected)
      Verify that the actual cookies contain a cookie with the given name whose path is equal to the given one.
      Parameters:
      name - the name of the cookie
      expected - the expected path of the cookie
    • hasDomain

      public CookieMapAssert hasDomain(String name, String expected)
      Verify that the actual cookies contain a cookie with the given name whose domain is equal to the given one.
      Parameters:
      name - the name of the cookie
      expected - the expected domain of the cookie
    • isSecure

      public CookieMapAssert isSecure(String name, boolean expected)
      Verify that the actual cookies contain a cookie with the given name whose secure flag is equal to the give one.
      Parameters:
      name - the name of the cookie
      expected - whether the cookie is secure
    • isHttpOnly

      public CookieMapAssert isHttpOnly(String name, boolean expected)
      Verify that the actual cookies contain a cookie with the given name whose http only flag is equal to the given one.
      Parameters:
      name - the name of the cookie
      expected - whether the cookie is http only