类 StatusResultMatchers
java.lang.Object
cn.taketoday.test.web.servlet.result.StatusResultMatchers
Factory for assertions on the response status.
An instance of this class is typically accessed via
MockMvcResultMatchers.status().
- 从以下版本开始:
- 4.0
- 作者:
- Keesun Baik, Rossen Stoyanchev, Sebastien Deleuze, Brian Clozel
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明private cn.taketoday.http.HttpStatus.SeriesgetHttpStatusSeries(MvcResult result) is(int status) Assert the response status code is equal to an integer value.Assert the response status code with the given HamcrestMatcher.Assert 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.ALREADY_REPORTED(208).Assert the response status code isHttpStatus.BAD_GATEWAY(502).Assert the response status code isHttpStatus.BAD_REQUEST(400).Assert the response status code isHttpStatus.BANDWIDTH_LIMIT_EXCEEDED(509).Assert the response status code isHttpStatus.CHECKPOINT(103).Assert the response status code isHttpStatus.CONFLICT(409).Assert the response status code isHttpStatus.CONTINUE(100).Assert the response status code isHttpStatus.CREATED(201).已过时。Assert the response status code isHttpStatus.EARLY_HINTS(103).Assert the response status code isHttpStatus.EXPECTATION_FAILED(417).Assert the response status code isHttpStatus.FAILED_DEPENDENCY(424).Assert the response status code isHttpStatus.FORBIDDEN(403).isFound()Assert the response status code isHttpStatus.FOUND(302).Assert the response status code isHttpStatus.GATEWAY_TIMEOUT(504).isGone()Assert the response status code isHttpStatus.GONE(410).Assert the response status code isHttpStatus.HTTP_VERSION_NOT_SUPPORTED(505).Assert the response status code isHttpStatus.I_AM_A_TEAPOT(418).isImUsed()Assert the response status code isHttpStatus.IM_USED(226).已过时。matching the deprecation ofHttpStatus.INSUFFICIENT_SPACE_ON_RESOURCEAssert the response status code isHttpStatus.INSUFFICIENT_STORAGE(507).Assert the response status code isHttpStatus.INTERNAL_SERVER_ERROR(500).Assert the response status code isHttpStatus.LENGTH_REQUIRED(411).isLocked()Assert the response status code isHttpStatus.LOCKED(423).Assert the response status code isHttpStatus.LOOP_DETECTED(508).已过时。matching the deprecation ofHttpStatus.METHOD_FAILUREAssert the response status code isHttpStatus.METHOD_NOT_ALLOWED(405).Assert the response status code isHttpStatus.MOVED_PERMANENTLY(301).已过时。in favor ofisFound()Assert the response status code isHttpStatus.MULTIPLE_CHOICES(300).Assert the response status code isHttpStatus.MULTI_STATUS(207).Assert the response status code isHttpStatus.NETWORK_AUTHENTICATION_REQUIRED(511).Assert the response status code isHttpStatus.NO_CONTENT(204).Assert the response status code isHttpStatus.NON_AUTHORITATIVE_INFORMATION(203).Assert the response status code isHttpStatus.NOT_ACCEPTABLE(406).Assert the response status code isHttpStatus.NOT_EXTENDED(510).Assert the response status code isHttpStatus.NOT_FOUND(404).Assert the response status code isHttpStatus.NOT_IMPLEMENTED(501).Assert the response status code isHttpStatus.NOT_MODIFIED(304).isOk()Assert the response status code isHttpStatus.OK(200).Assert the response status code isHttpStatus.PARTIAL_CONTENT(206).Assert the response status code isHttpStatus.PAYLOAD_TOO_LARGE(413).Assert the response status code isHttpStatus.PAYMENT_REQUIRED(402).Assert the response status code isHttpStatus.PERMANENT_REDIRECT(308).Assert the response status code isHttpStatus.PRECONDITION_FAILED(412).Assert the response status code isHttpStatus.PRECONDITION_REQUIRED(428).Assert the response status code isHttpStatus.PROCESSING(102).Assert the response status code isHttpStatus.PROXY_AUTHENTICATION_REQUIRED(407).Assert the response status code isHttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE(416).已过时。matching the deprecation ofHttpStatus.REQUEST_ENTITY_TOO_LARGEAssert the response status code isHttpStatus.REQUEST_HEADER_FIELDS_TOO_LARGE(431).Assert the response status code isHttpStatus.REQUEST_TIMEOUT(408).已过时。matching the deprecation ofHttpStatus.REQUEST_URI_TOO_LONGAssert the response status code isHttpStatus.RESET_CONTENT(205).Assert the response status code isHttpStatus.SEE_OTHER(303).Assert the response status code isHttpStatus.SERVICE_UNAVAILABLE(503).Assert the response status code isHttpStatus.SWITCHING_PROTOCOLS(101).Assert the response status code isHttpStatus.TEMPORARY_REDIRECT(307).Assert the response status code isHttpStatus.TOO_EARLY(425).Assert the response status code isHttpStatus.TOO_MANY_REQUESTS(429).Assert the response status code isHttpStatus.UNAUTHORIZED(401).Assert the response status code isHttpStatus.UNAVAILABLE_FOR_LEGAL_REASONS(451).Assert the response status code isHttpStatus.UNPROCESSABLE_ENTITY(422).Assert the response status code isHttpStatus.UNSUPPORTED_MEDIA_TYPE(415).Assert the response status code isHttpStatus.UPGRADE_REQUIRED(426).Assert the response status code isHttpStatus.REQUEST_URI_TOO_LONG(414).已过时。matching the deprecation ofHttpStatus.USE_PROXYAssert the response status code isHttpStatus.VARIANT_ALSO_NEGOTIATES(506).private ResultMatchermatcher(cn.taketoday.http.HttpStatusCode status) Match the expected response status to that of the HttpServletResponse.Assert the Servlet response error message.Assert the Servlet response error message with the given HamcrestMatcher.
-
构造器详细资料
-
StatusResultMatchers
protected StatusResultMatchers()Protected constructor. UseMockMvcResultMatchers.status().
-
-
方法详细资料
-
is
Assert the response status code with the given HamcrestMatcher. Use theStatusResultMatchers.isEqualToextension in Kotlin. -
is
Assert the response status code is equal to an integer value. Use theStatusResultMatchers.isEqualToextension in Kotlin. -
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. -
getHttpStatusSeries
-
reason
Assert the Servlet response error message with the given HamcrestMatcher. -
reason
Assert the Servlet response error message. -
isContinue
Assert the response status code isHttpStatus.CONTINUE(100). -
isSwitchingProtocols
Assert the response status code isHttpStatus.SWITCHING_PROTOCOLS(101). -
isProcessing
Assert the response status code isHttpStatus.PROCESSING(102). -
isCheckpoint
Assert the response status code isHttpStatus.CHECKPOINT(103).- 另请参阅:
-
isEarlyHints
Assert the response status code isHttpStatus.EARLY_HINTS(103). -
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). -
isNonAuthoritativeInformation
Assert the response status code isHttpStatus.NON_AUTHORITATIVE_INFORMATION(203). -
isNoContent
Assert the response status code isHttpStatus.NO_CONTENT(204). -
isResetContent
Assert the response status code isHttpStatus.RESET_CONTENT(205). -
isPartialContent
Assert the response status code isHttpStatus.PARTIAL_CONTENT(206). -
isMultiStatus
Assert the response status code isHttpStatus.MULTI_STATUS(207). -
isAlreadyReported
Assert the response status code isHttpStatus.ALREADY_REPORTED(208). -
isImUsed
Assert the response status code isHttpStatus.IM_USED(226). -
isMultipleChoices
Assert the response status code isHttpStatus.MULTIPLE_CHOICES(300). -
isMovedPermanently
Assert the response status code isHttpStatus.MOVED_PERMANENTLY(301). -
isFound
Assert the response status code isHttpStatus.FOUND(302). -
isMovedTemporarily
已过时。in favor ofisFound()Assert the response status code isHttpStatus.MOVED_TEMPORARILY(302).- 另请参阅:
-
isSeeOther
Assert the response status code isHttpStatus.SEE_OTHER(303). -
isNotModified
Assert the response status code isHttpStatus.NOT_MODIFIED(304). -
isUseProxy
已过时。matching the deprecation ofHttpStatus.USE_PROXYAssert the response status code isHttpStatus.USE_PROXY(305). -
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). -
isPaymentRequired
Assert the response status code isHttpStatus.PAYMENT_REQUIRED(402). -
isForbidden
Assert the response status code isHttpStatus.FORBIDDEN(403). -
isNotFound
Assert the response status code isHttpStatus.NOT_FOUND(404). -
isMethodNotAllowed
Assert the response status code isHttpStatus.METHOD_NOT_ALLOWED(405). -
isNotAcceptable
Assert the response status code isHttpStatus.NOT_ACCEPTABLE(406). -
isProxyAuthenticationRequired
Assert the response status code isHttpStatus.PROXY_AUTHENTICATION_REQUIRED(407). -
isRequestTimeout
Assert the response status code isHttpStatus.REQUEST_TIMEOUT(408). -
isConflict
Assert the response status code isHttpStatus.CONFLICT(409). -
isGone
Assert the response status code isHttpStatus.GONE(410). -
isLengthRequired
Assert the response status code isHttpStatus.LENGTH_REQUIRED(411). -
isPreconditionFailed
Assert the response status code isHttpStatus.PRECONDITION_FAILED(412). -
isPayloadTooLarge
Assert the response status code isHttpStatus.PAYLOAD_TOO_LARGE(413).- 从以下版本开始:
- 4.0
-
isRequestEntityTooLarge
已过时。matching the deprecation ofHttpStatus.REQUEST_ENTITY_TOO_LARGEAssert the response status code isHttpStatus.REQUEST_ENTITY_TOO_LARGE(413).- 另请参阅:
-
isUriTooLong
Assert the response status code isHttpStatus.REQUEST_URI_TOO_LONG(414).- 从以下版本开始:
- 4.0
-
isRequestUriTooLong
已过时。matching the deprecation ofHttpStatus.REQUEST_URI_TOO_LONGAssert the response status code isHttpStatus.REQUEST_URI_TOO_LONG(414).- 另请参阅:
-
isUnsupportedMediaType
Assert the response status code isHttpStatus.UNSUPPORTED_MEDIA_TYPE(415). -
isRequestedRangeNotSatisfiable
Assert the response status code isHttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE(416). -
isExpectationFailed
Assert the response status code isHttpStatus.EXPECTATION_FAILED(417). -
isIAmATeapot
Assert the response status code isHttpStatus.I_AM_A_TEAPOT(418). -
isInsufficientSpaceOnResource
已过时。matching the deprecation ofHttpStatus.INSUFFICIENT_SPACE_ON_RESOURCEAssert the response status code isHttpStatus.INSUFFICIENT_SPACE_ON_RESOURCE(419). -
isMethodFailure
已过时。matching the deprecation ofHttpStatus.METHOD_FAILUREAssert the response status code isHttpStatus.METHOD_FAILURE(420). -
isDestinationLocked
已过时。matching the deprecation ofHttpStatus.DESTINATION_LOCKEDAssert the response status code isHttpStatus.DESTINATION_LOCKED(421). -
isUnprocessableEntity
Assert the response status code isHttpStatus.UNPROCESSABLE_ENTITY(422). -
isLocked
Assert the response status code isHttpStatus.LOCKED(423). -
isFailedDependency
Assert the response status code isHttpStatus.FAILED_DEPENDENCY(424). -
isTooEarly
Assert the response status code isHttpStatus.TOO_EARLY(425). -
isUpgradeRequired
Assert the response status code isHttpStatus.UPGRADE_REQUIRED(426). -
isPreconditionRequired
Assert the response status code isHttpStatus.PRECONDITION_REQUIRED(428). -
isTooManyRequests
Assert the response status code isHttpStatus.TOO_MANY_REQUESTS(429). -
isRequestHeaderFieldsTooLarge
Assert the response status code isHttpStatus.REQUEST_HEADER_FIELDS_TOO_LARGE(431). -
isInternalServerError
Assert the response status code isHttpStatus.INTERNAL_SERVER_ERROR(500). -
isNotImplemented
Assert the response status code isHttpStatus.NOT_IMPLEMENTED(501). -
isBadGateway
Assert the response status code isHttpStatus.BAD_GATEWAY(502). -
isGatewayTimeout
Assert the response status code isHttpStatus.GATEWAY_TIMEOUT(504). -
isHttpVersionNotSupported
Assert the response status code isHttpStatus.HTTP_VERSION_NOT_SUPPORTED(505). -
isVariantAlsoNegotiates
Assert the response status code isHttpStatus.VARIANT_ALSO_NEGOTIATES(506). -
isInsufficientStorage
Assert the response status code isHttpStatus.INSUFFICIENT_STORAGE(507). -
isLoopDetected
Assert the response status code isHttpStatus.LOOP_DETECTED(508). -
isBandwidthLimitExceeded
Assert the response status code isHttpStatus.BANDWIDTH_LIMIT_EXCEEDED(509). -
isNotExtended
Assert the response status code isHttpStatus.NOT_EXTENDED(510). -
isNetworkAuthenticationRequired
Assert the response status code isHttpStatus.NETWORK_AUTHENTICATION_REQUIRED(511). -
matcher
Match the expected response status to that of the HttpServletResponse.
-
HttpStatus.DESTINATION_LOCKED