Class StatusAssertions
java.lang.Object
org.springframework.test.web.reactive.server.StatusAssertions
Assertions on the response status.
- Since:
- 5.0
- Author:
- Rossen Stoyanchev
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAssert the response status code is in the 1xx range.Assert the response status code is in the 2xx range.Assert the response status code is in the 3xx range.Assert the response status code is in the 4xx range.Assert the response status code is in the 5xx range.Assert the response status code isHttpStatus.ACCEPTED
(202).Assert the response status code isHttpStatus.BAD_REQUEST
(400).Assert the response status code isHttpStatus.CREATED
(201).isEqualTo
(int status) Assert the response status as an integer.isEqualTo
(HttpStatusCode status) Assert the response status as anHttpStatusCode
.Assert the response status code isHttpStatus.FORBIDDEN
(403).isFound()
Assert the response status code isHttpStatus.FOUND
(302).Assert the response status code isHttpStatus.NO_CONTENT
(204).Assert the response status code isHttpStatus.NOT_FOUND
(404).Assert the response status code isHttpStatus.NOT_MODIFIED
(304).isOk()
Assert the response status code isHttpStatus.OK
(200).Assert the response status code isHttpStatus.PERMANENT_REDIRECT
(308).Assert the response status code isHttpStatus.SEE_OTHER
(303).Assert the response status code isHttpStatus.TEMPORARY_REDIRECT
(307).Assert the response status code isHttpStatus.UNAUTHORIZED
(401).reasonEquals
(String reason) Assert the response error message.Consume the response status value as an integer.Match the response status value with a Hamcrest matcher.
-
Method Details
-
isEqualTo
Assert the response status as anHttpStatusCode
. -
isEqualTo
Assert the response status as an integer. -
isOk
Assert the response status code isHttpStatus.OK
(200). -
isCreated
Assert the response status code isHttpStatus.CREATED
(201). -
isAccepted
Assert the response status code isHttpStatus.ACCEPTED
(202). -
isNoContent
Assert the response status code isHttpStatus.NO_CONTENT
(204). -
isFound
Assert the response status code isHttpStatus.FOUND
(302). -
isSeeOther
Assert the response status code isHttpStatus.SEE_OTHER
(303). -
isNotModified
Assert the response status code isHttpStatus.NOT_MODIFIED
(304). -
isTemporaryRedirect
Assert the response status code isHttpStatus.TEMPORARY_REDIRECT
(307). -
isPermanentRedirect
Assert the response status code isHttpStatus.PERMANENT_REDIRECT
(308). -
isBadRequest
Assert the response status code isHttpStatus.BAD_REQUEST
(400). -
isUnauthorized
Assert the response status code isHttpStatus.UNAUTHORIZED
(401). -
isForbidden
Assert the response status code isHttpStatus.FORBIDDEN
(403).- Since:
- 5.0.2
-
isNotFound
Assert the response status code isHttpStatus.NOT_FOUND
(404). -
reasonEquals
Assert the response error message. -
is1xxInformational
Assert the response status code is in the 1xx range. -
is2xxSuccessful
Assert the response status code is in the 2xx range. -
is3xxRedirection
Assert the response status code is in the 3xx range. -
is4xxClientError
Assert the response status code is in the 4xx range. -
is5xxServerError
Assert the response status code is in the 5xx range. -
value
Match the response status value with a Hamcrest matcher.- Parameters:
matcher
- the matcher to use- Since:
- 5.1
-
value
Consume the response status value as an integer.- Parameters:
consumer
- the consumer to use- Since:
- 5.1
-