/** * Assert the response status code is {@code HttpStatus.SWITCHING_PROTOCOLS} (101). */ public ResultMatcher isSwitchingProtocols() { return matcher(HttpStatus.SWITCHING_PROTOCOLS); }
/** * Access to response status assertions. */ public static StatusResultMatchers status() { return new StatusResultMatchers(); }
/** * Access to response body assertions. */ public static ContentResultMatchers content() { return new ContentResultMatchers(); }
/** * Parse the expected and actual strings as JSON and assert the two * are "similar" - i.e. they contain the same attribute-value pairs * regardless of formatting with a lenient checking (extensible, and non-strict array * ordering). * @param jsonContent the expected JSON content * @since 4.1 */ public ResultMatcher json(final String jsonContent) { return json(jsonContent, false); }
/** * Access to response cookie assertions. */ public static CookieResultMatchers cookie() { return new CookieResultMatchers(); }
/** * Assert a cookie exists. The existence check is irrespective of whether * max age is 0 (i.e. expired). */ public ResultMatcher exists(final String name) { return result -> getCookie(result, name); }
/** * Access to response header assertions. */ public static HeaderResultMatchers header() { return new HeaderResultMatchers(); }
/** * Assert the response status code is {@code HttpStatus.CREATED} (201). */ public ResultMatcher isCreated() { return matcher(HttpStatus.CREATED); }
/** * Assert the response status code is {@code HttpStatus.NO_CONTENT} (204). */ public ResultMatcher isNoContent() { return matcher(HttpStatus.NO_CONTENT); }
/** * Assert the response status code is {@code HttpStatus.RESET_CONTENT} (205). */ public ResultMatcher isResetContent() { return matcher(HttpStatus.RESET_CONTENT); }
/** * Assert the response status code is {@code HttpStatus.MOVED_PERMANENTLY} (301). */ public ResultMatcher isMovedPermanently() { return matcher(HttpStatus.MOVED_PERMANENTLY); }
/** * Assert the response status code is {@code HttpStatus.REQUEST_TIMEOUT} (408). */ public ResultMatcher isRequestTimeout() { return matcher(HttpStatus.REQUEST_TIMEOUT); }
/** * Assert the response status code is {@code HttpStatus.UNSUPPORTED_MEDIA_TYPE} (415). */ public ResultMatcher isUnsupportedMediaType() { return matcher(HttpStatus.UNSUPPORTED_MEDIA_TYPE); }
/** * Assert the response status code is {@code HttpStatus.UNPROCESSABLE_ENTITY} (422). */ public ResultMatcher isUnprocessableEntity() { return matcher(HttpStatus.UNPROCESSABLE_ENTITY); }
/** * Assert the response status code is {@code HttpStatus.FAILED_DEPENDENCY} (424). */ public ResultMatcher isFailedDependency() { return matcher(HttpStatus.FAILED_DEPENDENCY); }
/** * Assert the response status code is {@code HttpStatus.NOT_IMPLEMENTED} (501). */ public ResultMatcher isNotImplemented() { return matcher(HttpStatus.NOT_IMPLEMENTED); }
/** * Assert the response status code is {@code HttpStatus.OK} (200). */ public ResultMatcher isOk() { return matcher(HttpStatus.OK); }
/** * Assert the response status code is {@code HttpStatus.PAYMENT_REQUIRED} (402). */ public ResultMatcher isPaymentRequired() { return matcher(HttpStatus.PAYMENT_REQUIRED); }
/** * Assert the response status code is {@code HttpStatus.METHOD_NOT_ALLOWED} (405). */ public ResultMatcher isMethodNotAllowed() { return matcher(HttpStatus.METHOD_NOT_ALLOWED); }
/** * Assert the response status code is {@code HttpStatus.EXPECTATION_FAILED} (417). */ public ResultMatcher isExpectationFailed() { return matcher(HttpStatus.EXPECTATION_FAILED); }