public class HeaderAssertions
extends java.lang.Object
WebTestClient.ResponseSpec.expectHeader()
Modifier and Type | Field and Description |
---|---|
private ExchangeResult |
exchangeResult |
private WebTestClient.ResponseSpec |
responseSpec |
Constructor and Description |
---|
HeaderAssertions(ExchangeResult result,
WebTestClient.ResponseSpec spec) |
Modifier and Type | Method and Description |
---|---|
private WebTestClient.ResponseSpec |
assertHeader(java.lang.String name,
java.lang.Object expected,
java.lang.Object actual) |
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 |
expires(int expires)
Expect an "Expires" header with the given value.
|
private HttpHeaders |
getHeaders() |
private java.lang.String |
getMessage(java.lang.String headerName) |
WebTestClient.ResponseSpec |
lastModified(int lastModified)
Expect a "Last-Modified" header with the given value.
|
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)
Expect a header with the given name whose first value matches the
provided regex pattern.
|
private final ExchangeResult exchangeResult
private final WebTestClient.ResponseSpec responseSpec
HeaderAssertions(ExchangeResult result, WebTestClient.ResponseSpec spec)
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
- String pattern to pass to Pattern.compile(String)
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 expires(int expires)
public WebTestClient.ResponseSpec lastModified(int lastModified)
private HttpHeaders getHeaders()
private java.lang.String getMessage(java.lang.String headerName)
private WebTestClient.ResponseSpec assertHeader(java.lang.String name, @Nullable java.lang.Object expected, @Nullable java.lang.Object actual)