Package io.vertx.core.http
Interface HttpResponseExpectation
-
- All Superinterfaces:
Expectation<HttpResponseHead>
public interface HttpResponseExpectation extends Expectation<HttpResponseHead>
Common expectations for HTTP responses.- Author:
- Julien Viet
-
-
Field Summary
-
Method Summary
Static Methods Modifier and Type Method Description static HttpResponseExpectation
contentType(String mimeType)
Creates an expectation validating the response has acontent-type
header matching themimeType
.static HttpResponseExpectation
contentType(String... mimeTypes)
Creates an expectation validating the response has acontent-type
header matching one of themimeTypes
.static HttpResponseExpectation
contentType(List<String> mimeTypes)
Creates an expectation validating the response has acontent-type
header matching one of themimeTypes
.static HttpResponseExpectation
status(int statusCode)
Creates an expectation asserting that the status response code is equal tostatusCode
.static HttpResponseExpectation
status(int min, int max)
-
Methods inherited from interface io.vertx.core.Expectation
and, describe, or, test, wrappingFailure
-
-
-
-
Field Detail
-
SC_INFORMATIONAL_RESPONSE
static final HttpResponseExpectation SC_INFORMATIONAL_RESPONSE
Any 1XX informational response
-
SC_CONTINUE
static final HttpResponseExpectation SC_CONTINUE
100 Continue
-
SC_SWITCHING_PROTOCOLS
static final HttpResponseExpectation SC_SWITCHING_PROTOCOLS
101 Switching Protocols
-
SC_PROCESSING
static final HttpResponseExpectation SC_PROCESSING
102 Processing (WebDAV, RFC2518)
-
SC_EARLY_HINTS
static final HttpResponseExpectation SC_EARLY_HINTS
103 Early Hints
-
SC_SUCCESS
static final HttpResponseExpectation SC_SUCCESS
Any 2XX success
-
SC_OK
static final HttpResponseExpectation SC_OK
200 OK
-
SC_CREATED
static final HttpResponseExpectation SC_CREATED
201 Created
-
SC_ACCEPTED
static final HttpResponseExpectation SC_ACCEPTED
202 Accepted
-
SC_NON_AUTHORITATIVE_INFORMATION
static final HttpResponseExpectation SC_NON_AUTHORITATIVE_INFORMATION
203 Non-Authoritative Information (since HTTP/1.1)
-
SC_NO_CONTENT
static final HttpResponseExpectation SC_NO_CONTENT
204 No Content
-
SC_RESET_CONTENT
static final HttpResponseExpectation SC_RESET_CONTENT
205 Reset Content
-
SC_PARTIAL_CONTENT
static final HttpResponseExpectation SC_PARTIAL_CONTENT
206 Partial Content
-
SC_MULTI_STATUS
static final HttpResponseExpectation SC_MULTI_STATUS
207 Multi-Status (WebDAV, RFC2518)
-
SC_REDIRECTION
static final HttpResponseExpectation SC_REDIRECTION
Any 3XX redirection
-
SC_MULTIPLE_CHOICES
static final HttpResponseExpectation SC_MULTIPLE_CHOICES
300 Multiple Choices
-
SC_MOVED_PERMANENTLY
static final HttpResponseExpectation SC_MOVED_PERMANENTLY
301 Moved Permanently
-
SC_FOUND
static final HttpResponseExpectation SC_FOUND
302 Found
-
SC_SEE_OTHER
static final HttpResponseExpectation SC_SEE_OTHER
303 See Other (since HTTP/1.1)
-
SC_NOT_MODIFIED
static final HttpResponseExpectation SC_NOT_MODIFIED
304 Not Modified
-
SC_USE_PROXY
static final HttpResponseExpectation SC_USE_PROXY
305 Use Proxy (since HTTP/1.1)
-
SC_TEMPORARY_REDIRECT
static final HttpResponseExpectation SC_TEMPORARY_REDIRECT
307 Temporary Redirect (since HTTP/1.1)
-
SC_PERMANENT_REDIRECT
static final HttpResponseExpectation SC_PERMANENT_REDIRECT
308 Permanent Redirect (RFC7538)
-
SC_CLIENT_ERRORS
static final HttpResponseExpectation SC_CLIENT_ERRORS
Any 4XX client error
-
SC_BAD_REQUEST
static final HttpResponseExpectation SC_BAD_REQUEST
400 Bad Request
-
SC_UNAUTHORIZED
static final HttpResponseExpectation SC_UNAUTHORIZED
401 Unauthorized
-
SC_PAYMENT_REQUIRED
static final HttpResponseExpectation SC_PAYMENT_REQUIRED
402 Payment Required
-
SC_FORBIDDEN
static final HttpResponseExpectation SC_FORBIDDEN
403 Forbidden
-
SC_NOT_FOUND
static final HttpResponseExpectation SC_NOT_FOUND
404 Not Found
-
SC_METHOD_NOT_ALLOWED
static final HttpResponseExpectation SC_METHOD_NOT_ALLOWED
405 Method Not Allowed
-
SC_NOT_ACCEPTABLE
static final HttpResponseExpectation SC_NOT_ACCEPTABLE
406 Not Acceptable
-
SC_PROXY_AUTHENTICATION_REQUIRED
static final HttpResponseExpectation SC_PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required
-
SC_REQUEST_TIMEOUT
static final HttpResponseExpectation SC_REQUEST_TIMEOUT
408 Request Timeout
-
SC_CONFLICT
static final HttpResponseExpectation SC_CONFLICT
409 Conflict
-
SC_GONE
static final HttpResponseExpectation SC_GONE
410 Gone
-
SC_LENGTH_REQUIRED
static final HttpResponseExpectation SC_LENGTH_REQUIRED
411 Length Required
-
SC_PRECONDITION_FAILED
static final HttpResponseExpectation SC_PRECONDITION_FAILED
412 Precondition Failed
-
SC_REQUEST_ENTITY_TOO_LARGE
static final HttpResponseExpectation SC_REQUEST_ENTITY_TOO_LARGE
413 Request Entity Too Large
-
SC_REQUEST_URI_TOO_LONG
static final HttpResponseExpectation SC_REQUEST_URI_TOO_LONG
414 Request-URI Too Long
-
SC_UNSUPPORTED_MEDIA_TYPE
static final HttpResponseExpectation SC_UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type
-
SC_REQUESTED_RANGE_NOT_SATISFIABLE
static final HttpResponseExpectation SC_REQUESTED_RANGE_NOT_SATISFIABLE
416 Requested Range Not Satisfiable
-
SC_EXPECTATION_FAILED
static final HttpResponseExpectation SC_EXPECTATION_FAILED
417 Expectation Failed
-
SC_MISDIRECTED_REQUEST
static final HttpResponseExpectation SC_MISDIRECTED_REQUEST
421 Misdirected Request
-
SC_UNPROCESSABLE_ENTITY
static final HttpResponseExpectation SC_UNPROCESSABLE_ENTITY
422 Unprocessable Entity (WebDAV, RFC4918)
-
SC_LOCKED
static final HttpResponseExpectation SC_LOCKED
423 Locked (WebDAV, RFC4918)
-
SC_FAILED_DEPENDENCY
static final HttpResponseExpectation SC_FAILED_DEPENDENCY
424 Failed Dependency (WebDAV, RFC4918)
-
SC_UNORDERED_COLLECTION
static final HttpResponseExpectation SC_UNORDERED_COLLECTION
425 Unordered Collection (WebDAV, RFC3648)
-
SC_UPGRADE_REQUIRED
static final HttpResponseExpectation SC_UPGRADE_REQUIRED
426 Upgrade Required (RFC2817)
-
SC_PRECONDITION_REQUIRED
static final HttpResponseExpectation SC_PRECONDITION_REQUIRED
428 Precondition Required (RFC6585)
-
SC_TOO_MANY_REQUESTS
static final HttpResponseExpectation SC_TOO_MANY_REQUESTS
429 Too Many Requests (RFC6585)
-
SC_REQUEST_HEADER_FIELDS_TOO_LARGE
static final HttpResponseExpectation SC_REQUEST_HEADER_FIELDS_TOO_LARGE
431 Request Header Fields Too Large (RFC6585)
-
SC_SERVER_ERRORS
static final HttpResponseExpectation SC_SERVER_ERRORS
Any 5XX server error
-
SC_INTERNAL_SERVER_ERROR
static final HttpResponseExpectation SC_INTERNAL_SERVER_ERROR
500 Internal Server Error
-
SC_NOT_IMPLEMENTED
static final HttpResponseExpectation SC_NOT_IMPLEMENTED
501 Not Implemented
-
SC_BAD_GATEWAY
static final HttpResponseExpectation SC_BAD_GATEWAY
502 Bad Gateway
-
SC_SERVICE_UNAVAILABLE
static final HttpResponseExpectation SC_SERVICE_UNAVAILABLE
503 Service Unavailable
-
SC_GATEWAY_TIMEOUT
static final HttpResponseExpectation SC_GATEWAY_TIMEOUT
504 Gateway Timeout
-
SC_HTTP_VERSION_NOT_SUPPORTED
static final HttpResponseExpectation SC_HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported
-
SC_VARIANT_ALSO_NEGOTIATES
static final HttpResponseExpectation SC_VARIANT_ALSO_NEGOTIATES
506 Variant Also Negotiates (RFC2295)
-
SC_INSUFFICIENT_STORAGE
static final HttpResponseExpectation SC_INSUFFICIENT_STORAGE
507 Insufficient Storage (WebDAV, RFC4918)
-
SC_NOT_EXTENDED
static final HttpResponseExpectation SC_NOT_EXTENDED
510 Not Extended (RFC2774)
-
SC_NETWORK_AUTHENTICATION_REQUIRED
static final HttpResponseExpectation SC_NETWORK_AUTHENTICATION_REQUIRED
511 Network Authentication Required (RFC6585)
-
JSON
static final HttpResponseExpectation JSON
Creates an expectation validating the responsecontent-type
isapplication/json
.
-
-
Method Detail
-
status
static HttpResponseExpectation status(int statusCode)
Creates an expectation asserting that the status response code is equal tostatusCode
.- Parameters:
statusCode
- the expected status code
-
status
static HttpResponseExpectation status(int min, int max)
-
contentType
static HttpResponseExpectation contentType(String mimeType)
Creates an expectation validating the response has acontent-type
header matching themimeType
.- Parameters:
mimeType
- the mime type
-
contentType
static HttpResponseExpectation contentType(String... mimeTypes)
Creates an expectation validating the response has acontent-type
header matching one of themimeTypes
.- Parameters:
mimeTypes
- the list of mime types
-
contentType
static HttpResponseExpectation contentType(List<String> mimeTypes)
Creates an expectation validating the response has acontent-type
header matching one of themimeTypes
.- Parameters:
mimeTypes
- the list of mime types
-
-