public class StatusAssertions extends Object
WebTestClient.ResponseSpec.expectStatus()| Modifier and Type | Method and Description |
|---|---|
WebTestClient.ResponseSpec |
is1xxInformational()
Assert the response status code is in the 1xx range.
|
WebTestClient.ResponseSpec |
is2xxSuccessful()
Assert the response status code is in the 2xx range.
|
WebTestClient.ResponseSpec |
is3xxRedirection()
Assert the response status code is in the 3xx range.
|
WebTestClient.ResponseSpec |
is4xxClientError()
Assert the response status code is in the 4xx range.
|
WebTestClient.ResponseSpec |
is5xxServerError()
Assert the response status code is in the 5xx range.
|
WebTestClient.ResponseSpec |
isAccepted()
Assert the response status code is
HttpStatus.ACCEPTED (202). |
WebTestClient.ResponseSpec |
isBadRequest()
Assert the response status code is
HttpStatus.BAD_REQUEST (400). |
WebTestClient.ResponseSpec |
isCreated()
Assert the response status code is
HttpStatus.CREATED (201). |
WebTestClient.ResponseSpec |
isEqualTo(HttpStatus status)
Assert the response status as an
HttpStatus. |
WebTestClient.ResponseSpec |
isEqualTo(int status)
Assert the response status as an integer.
|
WebTestClient.ResponseSpec |
isForbidden()
Assert the response status code is
HttpStatus.FORBIDDEN (403). |
WebTestClient.ResponseSpec |
isFound()
Assert the response status code is
HttpStatus.FOUND (302). |
WebTestClient.ResponseSpec |
isNoContent()
Assert the response status code is
HttpStatus.NO_CONTENT (204). |
WebTestClient.ResponseSpec |
isNotFound()
Assert the response status code is
HttpStatus.NOT_FOUND (404). |
WebTestClient.ResponseSpec |
isNotModified()
Assert the response status code is
HttpStatus.NOT_MODIFIED (304). |
WebTestClient.ResponseSpec |
isOk()
Assert the response status code is
HttpStatus.OK (200). |
WebTestClient.ResponseSpec |
isPermanentRedirect()
Assert the response status code is
HttpStatus.PERMANENT_REDIRECT (308). |
WebTestClient.ResponseSpec |
isSeeOther()
Assert the response status code is
HttpStatus.SEE_OTHER (303). |
WebTestClient.ResponseSpec |
isTemporaryRedirect()
Assert the response status code is
HttpStatus.TEMPORARY_REDIRECT (307). |
WebTestClient.ResponseSpec |
isUnauthorized()
Assert the response status code is
HttpStatus.UNAUTHORIZED (401). |
WebTestClient.ResponseSpec |
reasonEquals(String reason)
Assert the response error message.
|
WebTestClient.ResponseSpec |
value(Consumer<Integer> consumer)
Consume the response status value as an integer.
|
WebTestClient.ResponseSpec |
value(Matcher<Integer> matcher)
Match the response status value with a Hamcrest matcher.
|
public WebTestClient.ResponseSpec isEqualTo(HttpStatus status)
HttpStatus.public WebTestClient.ResponseSpec isEqualTo(int status)
public WebTestClient.ResponseSpec isOk()
HttpStatus.OK (200).public WebTestClient.ResponseSpec isCreated()
HttpStatus.CREATED (201).public WebTestClient.ResponseSpec isAccepted()
HttpStatus.ACCEPTED (202).public WebTestClient.ResponseSpec isNoContent()
HttpStatus.NO_CONTENT (204).public WebTestClient.ResponseSpec isFound()
HttpStatus.FOUND (302).public WebTestClient.ResponseSpec isSeeOther()
HttpStatus.SEE_OTHER (303).public WebTestClient.ResponseSpec isNotModified()
HttpStatus.NOT_MODIFIED (304).public WebTestClient.ResponseSpec isTemporaryRedirect()
HttpStatus.TEMPORARY_REDIRECT (307).public WebTestClient.ResponseSpec isPermanentRedirect()
HttpStatus.PERMANENT_REDIRECT (308).public WebTestClient.ResponseSpec isBadRequest()
HttpStatus.BAD_REQUEST (400).public WebTestClient.ResponseSpec isUnauthorized()
HttpStatus.UNAUTHORIZED (401).public WebTestClient.ResponseSpec isForbidden()
HttpStatus.FORBIDDEN (403).public WebTestClient.ResponseSpec isNotFound()
HttpStatus.NOT_FOUND (404).public WebTestClient.ResponseSpec reasonEquals(String reason)
public WebTestClient.ResponseSpec is1xxInformational()
public WebTestClient.ResponseSpec is2xxSuccessful()
public WebTestClient.ResponseSpec is3xxRedirection()
public WebTestClient.ResponseSpec is4xxClientError()
public WebTestClient.ResponseSpec is5xxServerError()
public WebTestClient.ResponseSpec value(Matcher<Integer> matcher)
matcher - the matcher to usepublic WebTestClient.ResponseSpec value(Consumer<Integer> consumer)
consumer - the consumer to use