Package | Description |
---|---|
org.springframework.test.web.reactive.server |
Support for testing Spring WebFlux server endpoints via
WebTestClient . |
Modifier and Type | Method and Description |
---|---|
WebTestClient.ResponseSpec |
HeaderAssertions.cacheControl(CacheControl cacheControl)
Expect a "Cache-Control" header with the given value.
|
WebTestClient.ResponseSpec |
HeaderAssertions.contentDisposition(ContentDisposition contentDisposition)
Expect a "Content-Disposition" header with the given value.
|
WebTestClient.ResponseSpec |
HeaderAssertions.contentLength(long contentLength)
Expect a "Content-Length" header with the given value.
|
WebTestClient.ResponseSpec |
HeaderAssertions.contentType(MediaType mediaType)
Expect a "Content-Type" header with the given value.
|
WebTestClient.ResponseSpec |
HeaderAssertions.contentType(String mediaType)
Expect a "Content-Type" header with the given value.
|
WebTestClient.ResponseSpec |
HeaderAssertions.contentTypeCompatibleWith(MediaType mediaType)
Expect a "Content-Type" header compatible with the given value.
|
WebTestClient.ResponseSpec |
HeaderAssertions.contentTypeCompatibleWith(String mediaType)
Expect a "Content-Type" header compatible with the given value.
|
WebTestClient.ResponseSpec |
CookieAssertions.doesNotExist(String name)
Expect that the cookie with the given name is not present.
|
WebTestClient.ResponseSpec |
HeaderAssertions.doesNotExist(String name)
Expect that the header with the given name is not present.
|
WebTestClient.ResponseSpec |
CookieAssertions.domain(String name,
Matcher<? super String> matcher)
Assert a cookie's domain attribute with a Hamcrest
Matcher . |
WebTestClient.ResponseSpec |
CookieAssertions.domain(String name,
String expected)
Assert a cookie's domain attribute.
|
WebTestClient.ResponseSpec |
WebTestClient.RequestHeadersSpec.exchange()
Perform the exchange without a request body.
|
WebTestClient.ResponseSpec |
CookieAssertions.exists(String name)
Expect that the cookie with the given name is present.
|
WebTestClient.ResponseSpec |
HeaderAssertions.exists(String name)
Expect that the header with the given name is present.
|
WebTestClient.ResponseSpec |
WebTestClient.ResponseSpec.expectAll(WebTestClient.ResponseSpec.ResponseSpecConsumer... consumers)
Apply multiple assertions to a response with the given
consumers, with the guarantee that
all assertions will be applied even if one or more assertions fails
with an exception.
|
WebTestClient.ResponseSpec |
HeaderAssertions.expires(long expires)
Expect an "Expires" header with the given value.
|
WebTestClient.ResponseSpec |
CookieAssertions.httpOnly(String name,
boolean expected)
Assert a cookie's httpOnly attribute.
|
WebTestClient.ResponseSpec |
StatusAssertions.is1xxInformational()
Assert the response status code is in the 1xx range.
|
WebTestClient.ResponseSpec |
StatusAssertions.is2xxSuccessful()
Assert the response status code is in the 2xx range.
|
WebTestClient.ResponseSpec |
StatusAssertions.is3xxRedirection()
Assert the response status code is in the 3xx range.
|
WebTestClient.ResponseSpec |
StatusAssertions.is4xxClientError()
Assert the response status code is in the 4xx range.
|
WebTestClient.ResponseSpec |
StatusAssertions.is5xxServerError()
Assert the response status code is in the 5xx range.
|
WebTestClient.ResponseSpec |
StatusAssertions.isAccepted()
Assert the response status code is
HttpStatus.ACCEPTED (202). |
WebTestClient.ResponseSpec |
StatusAssertions.isBadRequest()
Assert the response status code is
HttpStatus.BAD_REQUEST (400). |
WebTestClient.ResponseSpec |
StatusAssertions.isCreated()
Assert the response status code is
HttpStatus.CREATED (201). |
WebTestClient.ResponseSpec |
StatusAssertions.isEqualTo(HttpStatus status)
Assert the response status as an
HttpStatus . |
WebTestClient.ResponseSpec |
StatusAssertions.isEqualTo(int status)
Assert the response status as an integer.
|
WebTestClient.ResponseSpec |
StatusAssertions.isForbidden()
Assert the response status code is
HttpStatus.FORBIDDEN (403). |
WebTestClient.ResponseSpec |
StatusAssertions.isFound()
Assert the response status code is
HttpStatus.FOUND (302). |
WebTestClient.ResponseSpec |
StatusAssertions.isNoContent()
Assert the response status code is
HttpStatus.NO_CONTENT (204). |
WebTestClient.ResponseSpec |
StatusAssertions.isNotFound()
Assert the response status code is
HttpStatus.NOT_FOUND (404). |
WebTestClient.ResponseSpec |
StatusAssertions.isNotModified()
Assert the response status code is
HttpStatus.NOT_MODIFIED (304). |
WebTestClient.ResponseSpec |
StatusAssertions.isOk()
Assert the response status code is
HttpStatus.OK (200). |
WebTestClient.ResponseSpec |
StatusAssertions.isPermanentRedirect()
Assert the response status code is
HttpStatus.PERMANENT_REDIRECT (308). |
WebTestClient.ResponseSpec |
StatusAssertions.isSeeOther()
Assert the response status code is
HttpStatus.SEE_OTHER (303). |
WebTestClient.ResponseSpec |
StatusAssertions.isTemporaryRedirect()
Assert the response status code is
HttpStatus.TEMPORARY_REDIRECT (307). |
WebTestClient.ResponseSpec |
StatusAssertions.isUnauthorized()
Assert the response status code is
HttpStatus.UNAUTHORIZED (401). |
WebTestClient.ResponseSpec |
HeaderAssertions.lastModified(long lastModified)
Expect a "Last-Modified" header with the given value.
|
WebTestClient.ResponseSpec |
HeaderAssertions.location(String location)
Expect a "Location" header with the given value.
|
WebTestClient.ResponseSpec |
CookieAssertions.maxAge(String name,
Duration expected)
Assert a cookie's maxAge attribute.
|
WebTestClient.ResponseSpec |
CookieAssertions.maxAge(String name,
Matcher<? super Long> matcher)
Assert a cookie's maxAge attribute with a Hamcrest
Matcher . |
WebTestClient.ResponseSpec |
CookieAssertions.path(String name,
Matcher<? super String> matcher)
Assert a cookie's path attribute with a Hamcrest
Matcher . |
WebTestClient.ResponseSpec |
CookieAssertions.path(String name,
String expected)
Assert a cookie's path attribute.
|
WebTestClient.ResponseSpec |
StatusAssertions.reasonEquals(String reason)
Assert the response error message.
|
WebTestClient.ResponseSpec |
CookieAssertions.sameSite(String name,
String expected)
Assert a cookie's sameSite attribute.
|
WebTestClient.ResponseSpec |
CookieAssertions.secure(String name,
boolean expected)
Assert a cookie's secure attribute.
|
WebTestClient.ResponseSpec |
StatusAssertions.value(Consumer<Integer> consumer)
Consume the response status value as an integer.
|
WebTestClient.ResponseSpec |
StatusAssertions.value(Matcher<? super Integer> matcher)
Match the response status value with a Hamcrest matcher.
|
WebTestClient.ResponseSpec |
CookieAssertions.value(String name,
Consumer<String> consumer)
Consume the value of the response cookie.
|
WebTestClient.ResponseSpec |
HeaderAssertions.value(String name,
Consumer<String> consumer)
Consume the first value of the named response header.
|
WebTestClient.ResponseSpec |
CookieAssertions.value(String name,
Matcher<? super String> matcher)
Assert the first value of the response cookie with a Hamcrest
Matcher . |
WebTestClient.ResponseSpec |
HeaderAssertions.value(String name,
Matcher<? super String> matcher)
Assert the first value of the response header with a Hamcrest
Matcher . |
WebTestClient.ResponseSpec |
HeaderAssertions.valueEquals(String headerName,
long value)
Expect a header with the given name to match the given long value.
|
WebTestClient.ResponseSpec |
HeaderAssertions.valueEquals(String headerName,
String... values)
Expect a header with the given name to match the specified values.
|
WebTestClient.ResponseSpec |
CookieAssertions.valueEquals(String name,
String value)
Expect a header with the given name to match the specified values.
|
WebTestClient.ResponseSpec |
HeaderAssertions.valueEqualsDate(String headerName,
long value)
Expect a header with the given name to match the specified long value
parsed into a date using the preferred date format described in RFC 7231.
|
WebTestClient.ResponseSpec |
HeaderAssertions.valueMatches(String name,
String pattern)
Match the first value of the response header with a regex.
|
WebTestClient.ResponseSpec |
HeaderAssertions.values(String name,
Consumer<List<String>> consumer)
Consume all values of the named response header.
|
WebTestClient.ResponseSpec |
HeaderAssertions.values(String name,
Matcher<? super Iterable<String>> matcher)
Assert all values of the response header with a Hamcrest
Matcher . |
WebTestClient.ResponseSpec |
HeaderAssertions.valuesMatch(String name,
String... patterns)
Match all values of the response header with the given regex
patterns which are applied to the values of the header in the
same order.
|
Constructor and Description |
---|
CookieAssertions(ExchangeResult exchangeResult,
WebTestClient.ResponseSpec responseSpec) |