public class CookieAssertions extends Object
Constructor and Description |
---|
CookieAssertions(ExchangeResult exchangeResult,
WebTestClient.ResponseSpec responseSpec) |
Modifier and Type | Method and Description |
---|---|
WebTestClient.ResponseSpec |
doesNotExist(String name)
Expect that the cookie with the given name is not present.
|
WebTestClient.ResponseSpec |
domain(String name,
Matcher<? super String> matcher)
Assert a cookie's domain attribute with a Hamcrest
Matcher . |
WebTestClient.ResponseSpec |
domain(String name,
String expected)
Assert a cookie's domain attribute.
|
WebTestClient.ResponseSpec |
exists(String name)
Expect that the cookie with the given name is present.
|
WebTestClient.ResponseSpec |
httpOnly(String name,
boolean expected)
Assert a cookie's httpOnly attribute.
|
WebTestClient.ResponseSpec |
maxAge(String name,
Duration expected)
Assert a cookie's maxAge attribute.
|
WebTestClient.ResponseSpec |
maxAge(String name,
Matcher<? super Long> matcher)
Assert a cookie's maxAge attribute with a Hamcrest
Matcher . |
WebTestClient.ResponseSpec |
path(String name,
Matcher<? super String> matcher)
Assert a cookie's path attribute with a Hamcrest
Matcher . |
WebTestClient.ResponseSpec |
path(String name,
String expected)
Assert a cookie's path attribute.
|
WebTestClient.ResponseSpec |
sameSite(String name,
String expected)
Assert a cookie's sameSite attribute.
|
WebTestClient.ResponseSpec |
secure(String name,
boolean expected)
Assert a cookie's secure attribute.
|
WebTestClient.ResponseSpec |
value(String name,
Consumer<String> consumer)
Consume the value of the response cookie.
|
WebTestClient.ResponseSpec |
value(String name,
Matcher<? super String> matcher)
Assert the first value of the response cookie with a Hamcrest
Matcher . |
WebTestClient.ResponseSpec |
valueEquals(String name,
String value)
Expect a header with the given name to match the specified values.
|
public CookieAssertions(ExchangeResult exchangeResult, WebTestClient.ResponseSpec responseSpec)
public WebTestClient.ResponseSpec valueEquals(String name, String value)
public WebTestClient.ResponseSpec value(String name, Matcher<? super String> matcher)
Matcher
.public WebTestClient.ResponseSpec value(String name, Consumer<String> consumer)
public WebTestClient.ResponseSpec exists(String name)
public WebTestClient.ResponseSpec doesNotExist(String name)
public WebTestClient.ResponseSpec maxAge(String name, Duration expected)
public WebTestClient.ResponseSpec maxAge(String name, Matcher<? super Long> matcher)
Matcher
.public WebTestClient.ResponseSpec path(String name, String expected)
public WebTestClient.ResponseSpec path(String name, Matcher<? super String> matcher)
Matcher
.public WebTestClient.ResponseSpec domain(String name, String expected)
public WebTestClient.ResponseSpec domain(String name, Matcher<? super String> matcher)
Matcher
.public WebTestClient.ResponseSpec secure(String name, boolean expected)
public WebTestClient.ResponseSpec httpOnly(String name, boolean expected)
public WebTestClient.ResponseSpec sameSite(String name, String expected)