public class HeaderAssertions
extends java.lang.Object
WebTestClient.ResponseSpec.expectHeader()
Modifier and Type | Method and Description |
---|---|
WebTestClient.ResponseSpec |
cacheControl(CacheControl cacheControl)
Expect a "Cache-Control" header with the given value.
|
WebTestClient.ResponseSpec |
contentDisposition(ContentDisposition contentDisposition)
Expect a "Content-Disposition" header with the given value.
|
WebTestClient.ResponseSpec |
contentLength(long contentLength)
Expect a "Content-Length" header with the given value.
|
WebTestClient.ResponseSpec |
contentType(MediaType mediaType)
Expect a "Content-Type" header with the given value.
|
WebTestClient.ResponseSpec |
contentType(java.lang.String mediaType)
Expect a "Content-Type" header with the given value.
|
WebTestClient.ResponseSpec |
contentTypeCompatibleWith(MediaType mediaType)
Expect a "Content-Type" header compatible with the given value.
|
WebTestClient.ResponseSpec |
contentTypeCompatibleWith(java.lang.String mediaType)
Expect a "Content-Type" header compatible with the given value.
|
WebTestClient.ResponseSpec |
doesNotExist(java.lang.String name)
Expect that the header with the given name is not present.
|
WebTestClient.ResponseSpec |
exists(java.lang.String name)
Expect that the header with the given name is present.
|
WebTestClient.ResponseSpec |
expires(long expires)
Expect an "Expires" header with the given value.
|
WebTestClient.ResponseSpec |
lastModified(long lastModified)
Expect a "Last-Modified" header with the given value.
|
WebTestClient.ResponseSpec |
value(java.lang.String name,
java.util.function.Consumer<java.lang.String> consumer)
Assert the primary value of the response header with a
Matcher . |
WebTestClient.ResponseSpec |
value(java.lang.String name,
org.hamcrest.Matcher<? super java.lang.String> matcher)
Assert the primary value of the response header with a
Matcher . |
WebTestClient.ResponseSpec |
valueEquals(java.lang.String headerName,
java.lang.String... values)
Expect a header with the given name to match the specified values.
|
WebTestClient.ResponseSpec |
valueMatches(java.lang.String name,
java.lang.String pattern)
Match the primary value of the response header with a regex.
|
public WebTestClient.ResponseSpec valueEquals(java.lang.String headerName, java.lang.String... values)
public WebTestClient.ResponseSpec valueMatches(java.lang.String name, java.lang.String pattern)
name
- the header namepattern
- the regex patternpublic WebTestClient.ResponseSpec value(java.lang.String name, org.hamcrest.Matcher<? super java.lang.String> matcher)
Matcher
.name
- the header namematcher
- the matcher to suepublic WebTestClient.ResponseSpec value(java.lang.String name, java.util.function.Consumer<java.lang.String> consumer)
Matcher
.name
- the header nameconsumer
- the matcher to suepublic WebTestClient.ResponseSpec exists(java.lang.String name)
public WebTestClient.ResponseSpec doesNotExist(java.lang.String name)
public WebTestClient.ResponseSpec cacheControl(CacheControl cacheControl)
public WebTestClient.ResponseSpec contentDisposition(ContentDisposition contentDisposition)
public WebTestClient.ResponseSpec contentLength(long contentLength)
public WebTestClient.ResponseSpec contentType(MediaType mediaType)
public WebTestClient.ResponseSpec contentType(java.lang.String mediaType)
public WebTestClient.ResponseSpec contentTypeCompatibleWith(MediaType mediaType)
public WebTestClient.ResponseSpec contentTypeCompatibleWith(java.lang.String mediaType)
public WebTestClient.ResponseSpec expires(long expires)
public WebTestClient.ResponseSpec lastModified(long lastModified)