public class StatusResultMatchers extends Object
An instance of this class is typically accessed via
MockMvcResultMatchers.status().
| Modifier | Constructor and Description |
|---|---|
protected |
StatusResultMatchers()
Protected constructor.
|
| Modifier and Type | Method and Description |
|---|---|
ResultMatcher |
is(int status)
Assert the response status code is equal to an integer value.
|
ResultMatcher |
is(Matcher<Integer> matcher)
Assert the response status code with the given Hamcrest
Matcher. |
ResultMatcher |
is1xxInformational()
Assert the response status code is in the 1xx range.
|
ResultMatcher |
is2xxSuccessful()
Assert the response status code is in the 2xx range.
|
ResultMatcher |
is3xxRedirection()
Assert the response status code is in the 3xx range.
|
ResultMatcher |
is4xxClientError()
Assert the response status code is in the 4xx range.
|
ResultMatcher |
is5xxServerError()
Assert the response status code is in the 5xx range.
|
ResultMatcher |
isAccepted()
Assert the response status code is
HttpStatus.ACCEPTED (202). |
ResultMatcher |
isAlreadyReported()
Assert the response status code is
HttpStatus.ALREADY_REPORTED (208). |
ResultMatcher |
isBadGateway()
Assert the response status code is
HttpStatus.BAD_GATEWAY (502). |
ResultMatcher |
isBadRequest()
Assert the response status code is
HttpStatus.BAD_REQUEST (400). |
ResultMatcher |
isBandwidthLimitExceeded()
Assert the response status code is
HttpStatus.BANDWIDTH_LIMIT_EXCEEDED (509). |
ResultMatcher |
isCheckpoint()
Assert the response status code is
HttpStatus.CHECKPOINT (103). |
ResultMatcher |
isConflict()
Assert the response status code is
HttpStatus.CONFLICT (409). |
ResultMatcher |
isContinue()
Assert the response status code is
HttpStatus.CONTINUE (100). |
ResultMatcher |
isCreated()
Assert the response status code is
HttpStatus.CREATED (201). |
ResultMatcher |
isDestinationLocked()
Deprecated.
matching the deprecation of
HttpStatus.DESTINATION_LOCKED |
ResultMatcher |
isExpectationFailed()
Assert the response status code is
HttpStatus.EXPECTATION_FAILED (417). |
ResultMatcher |
isFailedDependency()
Assert the response status code is
HttpStatus.FAILED_DEPENDENCY (424). |
ResultMatcher |
isForbidden()
Assert the response status code is
HttpStatus.FORBIDDEN (403). |
ResultMatcher |
isFound()
Assert the response status code is
HttpStatus.FOUND (302). |
ResultMatcher |
isGatewayTimeout()
Assert the response status code is
HttpStatus.GATEWAY_TIMEOUT (504). |
ResultMatcher |
isGone()
Assert the response status code is
HttpStatus.GONE (410). |
ResultMatcher |
isHttpVersionNotSupported()
Assert the response status code is
HttpStatus.HTTP_VERSION_NOT_SUPPORTED (505). |
ResultMatcher |
isIAmATeapot()
Assert the response status code is
HttpStatus.I_AM_A_TEAPOT (418). |
ResultMatcher |
isImUsed()
Assert the response status code is
HttpStatus.IM_USED (226). |
ResultMatcher |
isInsufficientSpaceOnResource()
Deprecated.
matching the deprecation of
HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE |
ResultMatcher |
isInsufficientStorage()
Assert the response status code is
HttpStatus.INSUFFICIENT_STORAGE (507). |
ResultMatcher |
isInternalServerError()
Assert the response status code is
HttpStatus.INTERNAL_SERVER_ERROR (500). |
ResultMatcher |
isLengthRequired()
Assert the response status code is
HttpStatus.LENGTH_REQUIRED (411). |
ResultMatcher |
isLocked()
Assert the response status code is
HttpStatus.LOCKED (423). |
ResultMatcher |
isLoopDetected()
Assert the response status code is
HttpStatus.LOOP_DETECTED (508). |
ResultMatcher |
isMethodFailure()
Deprecated.
matching the deprecation of
HttpStatus.METHOD_FAILURE |
ResultMatcher |
isMethodNotAllowed()
Assert the response status code is
HttpStatus.METHOD_NOT_ALLOWED (405). |
ResultMatcher |
isMovedPermanently()
Assert the response status code is
HttpStatus.MOVED_PERMANENTLY (301). |
ResultMatcher |
isMovedTemporarily()
Deprecated.
in favor of
isFound() |
ResultMatcher |
isMultipleChoices()
Assert the response status code is
HttpStatus.MULTIPLE_CHOICES (300). |
ResultMatcher |
isMultiStatus()
Assert the response status code is
HttpStatus.MULTI_STATUS (207). |
ResultMatcher |
isNetworkAuthenticationRequired()
Assert the response status code is
HttpStatus.NETWORK_AUTHENTICATION_REQUIRED (511). |
ResultMatcher |
isNoContent()
Assert the response status code is
HttpStatus.NO_CONTENT (204). |
ResultMatcher |
isNonAuthoritativeInformation()
Assert the response status code is
HttpStatus.NON_AUTHORITATIVE_INFORMATION (203). |
ResultMatcher |
isNotAcceptable()
Assert the response status code is
HttpStatus.NOT_ACCEPTABLE (406). |
ResultMatcher |
isNotExtended()
Assert the response status code is
HttpStatus.NOT_EXTENDED (510). |
ResultMatcher |
isNotFound()
Assert the response status code is
HttpStatus.NOT_FOUND (404). |
ResultMatcher |
isNotImplemented()
Assert the response status code is
HttpStatus.NOT_IMPLEMENTED (501). |
ResultMatcher |
isNotModified()
Assert the response status code is
HttpStatus.NOT_MODIFIED (304). |
ResultMatcher |
isOk()
Assert the response status code is
HttpStatus.OK (200). |
ResultMatcher |
isPartialContent()
Assert the response status code is
HttpStatus.PARTIAL_CONTENT (206). |
ResultMatcher |
isPayloadTooLarge()
Assert the response status code is
HttpStatus.PAYLOAD_TOO_LARGE (413). |
ResultMatcher |
isPaymentRequired()
Assert the response status code is
HttpStatus.PAYMENT_REQUIRED (402). |
ResultMatcher |
isPermanentRedirect()
Assert the response status code is
HttpStatus.PERMANENT_REDIRECT (308). |
ResultMatcher |
isPreconditionFailed()
Assert the response status code is
HttpStatus.PRECONDITION_FAILED (412). |
ResultMatcher |
isPreconditionRequired()
Assert the response status code is
HttpStatus.PRECONDITION_REQUIRED (428). |
ResultMatcher |
isProcessing()
Assert the response status code is
HttpStatus.PROCESSING (102). |
ResultMatcher |
isProxyAuthenticationRequired()
Assert the response status code is
HttpStatus.PROXY_AUTHENTICATION_REQUIRED (407). |
ResultMatcher |
isRequestedRangeNotSatisfiable()
Assert the response status code is
HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE (416). |
ResultMatcher |
isRequestEntityTooLarge()
Deprecated.
matching the deprecation of
HttpStatus.REQUEST_ENTITY_TOO_LARGE |
ResultMatcher |
isRequestHeaderFieldsTooLarge()
Assert the response status code is
HttpStatus.REQUEST_HEADER_FIELDS_TOO_LARGE (431). |
ResultMatcher |
isRequestTimeout()
Assert the response status code is
HttpStatus.REQUEST_TIMEOUT (408). |
ResultMatcher |
isRequestUriTooLong()
Deprecated.
matching the deprecation of
HttpStatus.REQUEST_URI_TOO_LONG |
ResultMatcher |
isResetContent()
Assert the response status code is
HttpStatus.RESET_CONTENT (205). |
ResultMatcher |
isSeeOther()
Assert the response status code is
HttpStatus.SEE_OTHER (303). |
ResultMatcher |
isServiceUnavailable()
Assert the response status code is
HttpStatus.SERVICE_UNAVAILABLE (503). |
ResultMatcher |
isSwitchingProtocols()
Assert the response status code is
HttpStatus.SWITCHING_PROTOCOLS (101). |
ResultMatcher |
isTemporaryRedirect()
Assert the response status code is
HttpStatus.TEMPORARY_REDIRECT (307). |
ResultMatcher |
isTooManyRequests()
Assert the response status code is
HttpStatus.TOO_MANY_REQUESTS (429). |
ResultMatcher |
isUnauthorized()
Assert the response status code is
HttpStatus.UNAUTHORIZED (401). |
ResultMatcher |
isUnavailableForLegalReasons()
Assert the response status code is
HttpStatus.UNAVAILABLE_FOR_LEGAL_REASONS (451). |
ResultMatcher |
isUnprocessableEntity()
Assert the response status code is
HttpStatus.UNPROCESSABLE_ENTITY (422). |
ResultMatcher |
isUnsupportedMediaType()
Assert the response status code is
HttpStatus.UNSUPPORTED_MEDIA_TYPE (415). |
ResultMatcher |
isUpgradeRequired()
Assert the response status code is
HttpStatus.UPGRADE_REQUIRED (426). |
ResultMatcher |
isUriTooLong()
Assert the response status code is
HttpStatus.REQUEST_URI_TOO_LONG (414). |
ResultMatcher |
isUseProxy()
Deprecated.
matching the deprecation of
HttpStatus.USE_PROXY |
ResultMatcher |
isVariantAlsoNegotiates()
Assert the response status code is
HttpStatus.VARIANT_ALSO_NEGOTIATES (506). |
ResultMatcher |
reason(Matcher<? super String> matcher)
Assert the Servlet response error message with the given Hamcrest
Matcher. |
ResultMatcher |
reason(String reason)
Assert the Servlet response error message.
|
protected StatusResultMatchers()
MockMvcResultMatchers.status().public ResultMatcher is(Matcher<Integer> matcher)
Matcher.
Use the StatusResultMatchers.isEqualTo extension in Kotlin.public ResultMatcher is(int status)
StatusResultMatchers.isEqualTo extension in Kotlin.public ResultMatcher is1xxInformational()
public ResultMatcher is2xxSuccessful()
public ResultMatcher is3xxRedirection()
public ResultMatcher is4xxClientError()
public ResultMatcher is5xxServerError()
public ResultMatcher reason(Matcher<? super String> matcher)
Matcher.public ResultMatcher reason(String reason)
public ResultMatcher isContinue()
HttpStatus.CONTINUE (100).public ResultMatcher isSwitchingProtocols()
HttpStatus.SWITCHING_PROTOCOLS (101).public ResultMatcher isProcessing()
HttpStatus.PROCESSING (102).public ResultMatcher isCheckpoint()
HttpStatus.CHECKPOINT (103).public ResultMatcher isOk()
HttpStatus.OK (200).public ResultMatcher isCreated()
HttpStatus.CREATED (201).public ResultMatcher isAccepted()
HttpStatus.ACCEPTED (202).public ResultMatcher isNonAuthoritativeInformation()
HttpStatus.NON_AUTHORITATIVE_INFORMATION (203).public ResultMatcher isNoContent()
HttpStatus.NO_CONTENT (204).public ResultMatcher isResetContent()
HttpStatus.RESET_CONTENT (205).public ResultMatcher isPartialContent()
HttpStatus.PARTIAL_CONTENT (206).public ResultMatcher isMultiStatus()
HttpStatus.MULTI_STATUS (207).public ResultMatcher isAlreadyReported()
HttpStatus.ALREADY_REPORTED (208).public ResultMatcher isImUsed()
HttpStatus.IM_USED (226).public ResultMatcher isMultipleChoices()
HttpStatus.MULTIPLE_CHOICES (300).public ResultMatcher isMovedPermanently()
HttpStatus.MOVED_PERMANENTLY (301).public ResultMatcher isFound()
HttpStatus.FOUND (302).@Deprecated public ResultMatcher isMovedTemporarily()
isFound()HttpStatus.MOVED_TEMPORARILY (302).isFound()public ResultMatcher isSeeOther()
HttpStatus.SEE_OTHER (303).public ResultMatcher isNotModified()
HttpStatus.NOT_MODIFIED (304).@Deprecated public ResultMatcher isUseProxy()
HttpStatus.USE_PROXYHttpStatus.USE_PROXY (305).public ResultMatcher isTemporaryRedirect()
HttpStatus.TEMPORARY_REDIRECT (307).public ResultMatcher isPermanentRedirect()
HttpStatus.PERMANENT_REDIRECT (308).public ResultMatcher isBadRequest()
HttpStatus.BAD_REQUEST (400).public ResultMatcher isUnauthorized()
HttpStatus.UNAUTHORIZED (401).public ResultMatcher isPaymentRequired()
HttpStatus.PAYMENT_REQUIRED (402).public ResultMatcher isForbidden()
HttpStatus.FORBIDDEN (403).public ResultMatcher isNotFound()
HttpStatus.NOT_FOUND (404).public ResultMatcher isMethodNotAllowed()
HttpStatus.METHOD_NOT_ALLOWED (405).public ResultMatcher isNotAcceptable()
HttpStatus.NOT_ACCEPTABLE (406).public ResultMatcher isProxyAuthenticationRequired()
HttpStatus.PROXY_AUTHENTICATION_REQUIRED (407).public ResultMatcher isRequestTimeout()
HttpStatus.REQUEST_TIMEOUT (408).public ResultMatcher isConflict()
HttpStatus.CONFLICT (409).public ResultMatcher isGone()
HttpStatus.GONE (410).public ResultMatcher isLengthRequired()
HttpStatus.LENGTH_REQUIRED (411).public ResultMatcher isPreconditionFailed()
HttpStatus.PRECONDITION_FAILED (412).public ResultMatcher isPayloadTooLarge()
HttpStatus.PAYLOAD_TOO_LARGE (413).@Deprecated public ResultMatcher isRequestEntityTooLarge()
HttpStatus.REQUEST_ENTITY_TOO_LARGEHttpStatus.REQUEST_ENTITY_TOO_LARGE (413).isPayloadTooLarge()public ResultMatcher isUriTooLong()
HttpStatus.REQUEST_URI_TOO_LONG (414).@Deprecated public ResultMatcher isRequestUriTooLong()
HttpStatus.REQUEST_URI_TOO_LONGHttpStatus.REQUEST_URI_TOO_LONG (414).isUriTooLong()public ResultMatcher isUnsupportedMediaType()
HttpStatus.UNSUPPORTED_MEDIA_TYPE (415).public ResultMatcher isRequestedRangeNotSatisfiable()
HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE (416).public ResultMatcher isExpectationFailed()
HttpStatus.EXPECTATION_FAILED (417).public ResultMatcher isIAmATeapot()
HttpStatus.I_AM_A_TEAPOT (418).@Deprecated public ResultMatcher isInsufficientSpaceOnResource()
HttpStatus.INSUFFICIENT_SPACE_ON_RESOURCEHttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE (419).@Deprecated public ResultMatcher isMethodFailure()
HttpStatus.METHOD_FAILUREHttpStatus.METHOD_FAILURE (420).@Deprecated public ResultMatcher isDestinationLocked()
HttpStatus.DESTINATION_LOCKEDHttpStatus.DESTINATION_LOCKED (421).public ResultMatcher isUnprocessableEntity()
HttpStatus.UNPROCESSABLE_ENTITY (422).public ResultMatcher isLocked()
HttpStatus.LOCKED (423).public ResultMatcher isFailedDependency()
HttpStatus.FAILED_DEPENDENCY (424).public ResultMatcher isUpgradeRequired()
HttpStatus.UPGRADE_REQUIRED (426).public ResultMatcher isPreconditionRequired()
HttpStatus.PRECONDITION_REQUIRED (428).public ResultMatcher isTooManyRequests()
HttpStatus.TOO_MANY_REQUESTS (429).public ResultMatcher isRequestHeaderFieldsTooLarge()
HttpStatus.REQUEST_HEADER_FIELDS_TOO_LARGE (431).public ResultMatcher isUnavailableForLegalReasons()
HttpStatus.UNAVAILABLE_FOR_LEGAL_REASONS (451).public ResultMatcher isInternalServerError()
HttpStatus.INTERNAL_SERVER_ERROR (500).public ResultMatcher isNotImplemented()
HttpStatus.NOT_IMPLEMENTED (501).public ResultMatcher isBadGateway()
HttpStatus.BAD_GATEWAY (502).public ResultMatcher isServiceUnavailable()
HttpStatus.SERVICE_UNAVAILABLE (503).public ResultMatcher isGatewayTimeout()
HttpStatus.GATEWAY_TIMEOUT (504).public ResultMatcher isHttpVersionNotSupported()
HttpStatus.HTTP_VERSION_NOT_SUPPORTED (505).public ResultMatcher isVariantAlsoNegotiates()
HttpStatus.VARIANT_ALSO_NEGOTIATES (506).public ResultMatcher isInsufficientStorage()
HttpStatus.INSUFFICIENT_STORAGE (507).public ResultMatcher isLoopDetected()
HttpStatus.LOOP_DETECTED (508).public ResultMatcher isBandwidthLimitExceeded()
HttpStatus.BANDWIDTH_LIMIT_EXCEEDED (509).public ResultMatcher isNotExtended()
HttpStatus.NOT_EXTENDED (510).public ResultMatcher isNetworkAuthenticationRequired()
HttpStatus.NETWORK_AUTHENTICATION_REQUIRED (511).