Interface HttpResponseExpectation
- All Superinterfaces:
Expectation<HttpResponseHead>
Common expectations for HTTP responses.
- Author:
- Julien Viet
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HttpResponseExpectationCreates an expectation validating the responsecontent-typeisapplication/json.static final HttpResponseExpectation202 Acceptedstatic final HttpResponseExpectation502 Bad Gatewaystatic final HttpResponseExpectation400 Bad Requeststatic final HttpResponseExpectationAny 4XX client errorstatic final HttpResponseExpectation409 Conflictstatic final HttpResponseExpectation100 Continuestatic final HttpResponseExpectation201 Createdstatic final HttpResponseExpectation103 Early Hintsstatic final HttpResponseExpectation417 Expectation Failedstatic final HttpResponseExpectation424 Failed Dependency (WebDAV, RFC4918)static final HttpResponseExpectation403 Forbiddenstatic final HttpResponseExpectation302 Foundstatic final HttpResponseExpectation504 Gateway Timeoutstatic final HttpResponseExpectation410 Gonestatic final HttpResponseExpectation505 HTTP Version Not Supportedstatic final HttpResponseExpectationAny 1XX informational responsestatic final HttpResponseExpectation507 Insufficient Storage (WebDAV, RFC4918)static final HttpResponseExpectation500 Internal Server Errorstatic final HttpResponseExpectation411 Length Requiredstatic final HttpResponseExpectation423 Locked (WebDAV, RFC4918)static final HttpResponseExpectation405 Method Not Allowedstatic final HttpResponseExpectation421 Misdirected Requeststatic final HttpResponseExpectation301 Moved Permanentlystatic final HttpResponseExpectation207 Multi-Status (WebDAV, RFC2518)static final HttpResponseExpectation300 Multiple Choicesstatic final HttpResponseExpectation511 Network Authentication Required (RFC6585)static final HttpResponseExpectation204 No Contentstatic final HttpResponseExpectation203 Non-Authoritative Information (since HTTP/1.1)static final HttpResponseExpectation406 Not Acceptablestatic final HttpResponseExpectation510 Not Extended (RFC2774)static final HttpResponseExpectation404 Not Foundstatic final HttpResponseExpectation501 Not Implementedstatic final HttpResponseExpectation304 Not Modifiedstatic final HttpResponseExpectation200 OKstatic final HttpResponseExpectation206 Partial Contentstatic final HttpResponseExpectation402 Payment Requiredstatic final HttpResponseExpectation308 Permanent Redirect (RFC7538)static final HttpResponseExpectation412 Precondition Failedstatic final HttpResponseExpectation428 Precondition Required (RFC6585)static final HttpResponseExpectation102 Processing (WebDAV, RFC2518)static final HttpResponseExpectation407 Proxy Authentication Requiredstatic final HttpResponseExpectationAny 3XX redirectionstatic final HttpResponseExpectation413 Request Entity Too Largestatic final HttpResponseExpectation431 Request Header Fields Too Large (RFC6585)static final HttpResponseExpectation408 Request Timeoutstatic final HttpResponseExpectation414 Request-URI Too Longstatic final HttpResponseExpectation416 Requested Range Not Satisfiablestatic final HttpResponseExpectation205 Reset Contentstatic final HttpResponseExpectation303 See Other (since HTTP/1.1)static final HttpResponseExpectationAny 5XX server errorstatic final HttpResponseExpectation503 Service Unavailablestatic final HttpResponseExpectationAny 2XX successstatic final HttpResponseExpectation101 Switching Protocolsstatic final HttpResponseExpectation307 Temporary Redirect (since HTTP/1.1)static final HttpResponseExpectation429 Too Many Requests (RFC6585)static final HttpResponseExpectation401 Unauthorizedstatic final HttpResponseExpectation425 Unordered Collection (WebDAV, RFC3648)static final HttpResponseExpectation422 Unprocessable Entity (WebDAV, RFC4918)static final HttpResponseExpectation415 Unsupported Media Typestatic final HttpResponseExpectation426 Upgrade Required (RFC2817)static final HttpResponseExpectation305 Use Proxy (since HTTP/1.1)static final HttpResponseExpectation506 Variant Also Negotiates (RFC2295) -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic HttpResponseExpectationcontentType(String mimeType) Creates an expectation validating the response has acontent-typeheader matching themimeType.static HttpResponseExpectationcontentType(String... mimeTypes) Creates an expectation validating the response has acontent-typeheader matching one of themimeTypes.static HttpResponseExpectationcontentType(List<String> mimeTypes) Creates an expectation validating the response has acontent-typeheader matching one of themimeTypes.static HttpResponseExpectationstatus(int statusCode) Creates an expectation asserting that the status response code is equal tostatusCode.static HttpResponseExpectationstatus(int min, int max) Methods inherited from interface Expectation
and, describe, or, test, wrappingFailure
-
Field Details
-
SC_INFORMATIONAL_RESPONSE
Any 1XX informational response -
SC_CONTINUE
100 Continue -
SC_SWITCHING_PROTOCOLS
101 Switching Protocols -
SC_PROCESSING
102 Processing (WebDAV, RFC2518) -
SC_EARLY_HINTS
103 Early Hints -
SC_SUCCESS
Any 2XX success -
SC_OK
200 OK -
SC_CREATED
201 Created -
SC_ACCEPTED
202 Accepted -
SC_NON_AUTHORITATIVE_INFORMATION
203 Non-Authoritative Information (since HTTP/1.1) -
SC_NO_CONTENT
204 No Content -
SC_RESET_CONTENT
205 Reset Content -
SC_PARTIAL_CONTENT
206 Partial Content -
SC_MULTI_STATUS
207 Multi-Status (WebDAV, RFC2518) -
SC_REDIRECTION
Any 3XX redirection -
SC_MULTIPLE_CHOICES
300 Multiple Choices -
SC_MOVED_PERMANENTLY
301 Moved Permanently -
SC_FOUND
302 Found -
SC_SEE_OTHER
303 See Other (since HTTP/1.1) -
SC_NOT_MODIFIED
304 Not Modified -
SC_USE_PROXY
305 Use Proxy (since HTTP/1.1) -
SC_TEMPORARY_REDIRECT
307 Temporary Redirect (since HTTP/1.1) -
SC_PERMANENT_REDIRECT
308 Permanent Redirect (RFC7538) -
SC_CLIENT_ERRORS
Any 4XX client error -
SC_BAD_REQUEST
400 Bad Request -
SC_UNAUTHORIZED
401 Unauthorized -
SC_PAYMENT_REQUIRED
402 Payment Required -
SC_FORBIDDEN
403 Forbidden -
SC_NOT_FOUND
404 Not Found -
SC_METHOD_NOT_ALLOWED
405 Method Not Allowed -
SC_NOT_ACCEPTABLE
406 Not Acceptable -
SC_PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required -
SC_REQUEST_TIMEOUT
408 Request Timeout -
SC_CONFLICT
409 Conflict -
SC_GONE
410 Gone -
SC_LENGTH_REQUIRED
411 Length Required -
SC_PRECONDITION_FAILED
412 Precondition Failed -
SC_REQUEST_ENTITY_TOO_LARGE
413 Request Entity Too Large -
SC_REQUEST_URI_TOO_LONG
414 Request-URI Too Long -
SC_UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type -
SC_REQUESTED_RANGE_NOT_SATISFIABLE
416 Requested Range Not Satisfiable -
SC_EXPECTATION_FAILED
417 Expectation Failed -
SC_MISDIRECTED_REQUEST
421 Misdirected Request -
SC_UNPROCESSABLE_ENTITY
422 Unprocessable Entity (WebDAV, RFC4918) -
SC_LOCKED
423 Locked (WebDAV, RFC4918) -
SC_FAILED_DEPENDENCY
424 Failed Dependency (WebDAV, RFC4918) -
SC_UNORDERED_COLLECTION
425 Unordered Collection (WebDAV, RFC3648) -
SC_UPGRADE_REQUIRED
426 Upgrade Required (RFC2817) -
SC_PRECONDITION_REQUIRED
428 Precondition Required (RFC6585) -
SC_TOO_MANY_REQUESTS
429 Too Many Requests (RFC6585) -
SC_REQUEST_HEADER_FIELDS_TOO_LARGE
431 Request Header Fields Too Large (RFC6585) -
SC_SERVER_ERRORS
Any 5XX server error -
SC_INTERNAL_SERVER_ERROR
500 Internal Server Error -
SC_NOT_IMPLEMENTED
501 Not Implemented -
SC_BAD_GATEWAY
502 Bad Gateway -
SC_SERVICE_UNAVAILABLE
503 Service Unavailable -
SC_GATEWAY_TIMEOUT
504 Gateway Timeout -
SC_HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported -
SC_VARIANT_ALSO_NEGOTIATES
506 Variant Also Negotiates (RFC2295) -
SC_INSUFFICIENT_STORAGE
507 Insufficient Storage (WebDAV, RFC4918) -
SC_NOT_EXTENDED
510 Not Extended (RFC2774) -
SC_NETWORK_AUTHENTICATION_REQUIRED
511 Network Authentication Required (RFC6585) -
JSON
Creates an expectation validating the responsecontent-typeisapplication/json.
-
-
Method Details
-
status
Creates an expectation asserting that the status response code is equal tostatusCode.- Parameters:
statusCode- the expected status code
-
status
-
contentType
Creates an expectation validating the response has acontent-typeheader matching themimeType.- Parameters:
mimeType- the mime type
-
contentType
Creates an expectation validating the response has acontent-typeheader matching one of themimeTypes.- Parameters:
mimeTypes- the list of mime types
-
contentType
Creates an expectation validating the response has acontent-typeheader matching one of themimeTypes.- Parameters:
mimeTypes- the list of mime types
-