Top Description Fields Methods
io.vertx.core.http

public Interface HttpResponseExpectation

extends Expectation<HttpResponseHead>
Imports
io.vertx.core.Expectation, .VertxException, java.util.Arrays, .Collections, .List

Common expectations for HTTP responses.
Author
Julien Viet

Field Summary

Modifier and TypeField and Description
public static final HttpResponseExpectation
JSON

Creates an expectation validating the response content-type is application/json.

public static final HttpResponseExpectation
SC_ACCEPTED

202 Accepted

public static final HttpResponseExpectation
SC_BAD_GATEWAY

502 Bad Gateway

public static final HttpResponseExpectation
SC_BAD_REQUEST

400 Bad Request

public static final HttpResponseExpectation
SC_CLIENT_ERRORS

Any 4XX client error

public static final HttpResponseExpectation
SC_CONFLICT

409 Conflict

public static final HttpResponseExpectation
SC_CONTINUE

100 Continue

public static final HttpResponseExpectation
SC_CREATED

201 Created

public static final HttpResponseExpectation
SC_EARLY_HINTS

103 Early Hints

public static final HttpResponseExpectation
SC_EXPECTATION_FAILED

417 Expectation Failed

public static final HttpResponseExpectation
SC_FAILED_DEPENDENCY

424 Failed Dependency (WebDAV, RFC4918)

public static final HttpResponseExpectation
SC_FORBIDDEN

403 Forbidden

public static final HttpResponseExpectation
SC_FOUND

302 Found

public static final HttpResponseExpectation
SC_GATEWAY_TIMEOUT

504 Gateway Timeout

public static final HttpResponseExpectation
SC_GONE

410 Gone

public static final HttpResponseExpectation
SC_HTTP_VERSION_NOT_SUPPORTED

505 HTTP Version Not Supported

public static final HttpResponseExpectation
SC_INFORMATIONAL_RESPONSE

Any 1XX informational response

public static final HttpResponseExpectation
SC_INSUFFICIENT_STORAGE

507 Insufficient Storage (WebDAV, RFC4918)

public static final HttpResponseExpectation
SC_INTERNAL_SERVER_ERROR

500 Internal Server Error

public static final HttpResponseExpectation
SC_LENGTH_REQUIRED

411 Length Required

public static final HttpResponseExpectation
SC_LOCKED

423 Locked (WebDAV, RFC4918)

public static final HttpResponseExpectation
SC_METHOD_NOT_ALLOWED

405 Method Not Allowed

public static final HttpResponseExpectation
SC_MISDIRECTED_REQUEST

421 Misdirected Request

public static final HttpResponseExpectation
SC_MOVED_PERMANENTLY

301 Moved Permanently

public static final HttpResponseExpectation
SC_MULTI_STATUS

207 Multi-Status (WebDAV, RFC2518)

public static final HttpResponseExpectation
SC_MULTIPLE_CHOICES

300 Multiple Choices

public static final HttpResponseExpectation
SC_NETWORK_AUTHENTICATION_REQUIRED

511 Network Authentication Required (RFC6585)

public static final HttpResponseExpectation
SC_NO_CONTENT

204 No Content

public static final HttpResponseExpectation
SC_NON_AUTHORITATIVE_INFORMATION

203 Non-Authoritative Information (since HTTP/1.1)

public static final HttpResponseExpectation
SC_NOT_ACCEPTABLE

406 Not Acceptable

public static final HttpResponseExpectation
SC_NOT_EXTENDED

510 Not Extended (RFC2774)

public static final HttpResponseExpectation
SC_NOT_FOUND

404 Not Found

public static final HttpResponseExpectation
SC_NOT_IMPLEMENTED

501 Not Implemented

public static final HttpResponseExpectation
SC_NOT_MODIFIED

304 Not Modified

public static final HttpResponseExpectation
SC_OK

200 OK

public static final HttpResponseExpectation
SC_PARTIAL_CONTENT

206 Partial Content

public static final HttpResponseExpectation
SC_PAYMENT_REQUIRED

402 Payment Required

public static final HttpResponseExpectation
SC_PERMANENT_REDIRECT

308 Permanent Redirect (RFC7538)

public static final HttpResponseExpectation
SC_PRECONDITION_FAILED

412 Precondition Failed

public static final HttpResponseExpectation
SC_PRECONDITION_REQUIRED

428 Precondition Required (RFC6585)

public static final HttpResponseExpectation
SC_PROCESSING

102 Processing (WebDAV, RFC2518)

public static final HttpResponseExpectation
SC_PROXY_AUTHENTICATION_REQUIRED

407 Proxy Authentication Required

public static final HttpResponseExpectation
SC_REDIRECTION

Any 3XX redirection

public static final HttpResponseExpectation
SC_REQUEST_ENTITY_TOO_LARGE

413 Request Entity Too Large

public static final HttpResponseExpectation
SC_REQUEST_HEADER_FIELDS_TOO_LARGE

431 Request Header Fields Too Large (RFC6585)

public static final HttpResponseExpectation
SC_REQUEST_TIMEOUT

408 Request Timeout

public static final HttpResponseExpectation
SC_REQUEST_URI_TOO_LONG

414 Request-URI Too Long

public static final HttpResponseExpectation
SC_REQUESTED_RANGE_NOT_SATISFIABLE

416 Requested Range Not Satisfiable

public static final HttpResponseExpectation
SC_RESET_CONTENT

205 Reset Content

public static final HttpResponseExpectation
SC_SEE_OTHER

303 See Other (since HTTP/1.1)

public static final HttpResponseExpectation
SC_SERVER_ERRORS

Any 5XX server error

public static final HttpResponseExpectation
SC_SERVICE_UNAVAILABLE

503 Service Unavailable

public static final HttpResponseExpectation
SC_SUCCESS

Any 2XX success

public static final HttpResponseExpectation
SC_SWITCHING_PROTOCOLS

101 Switching Protocols

public static final HttpResponseExpectation
SC_TEMPORARY_REDIRECT

307 Temporary Redirect (since HTTP/1.1)

public static final HttpResponseExpectation
SC_TOO_MANY_REQUESTS

429 Too Many Requests (RFC6585)

public static final HttpResponseExpectation
SC_UNAUTHORIZED

401 Unauthorized

public static final HttpResponseExpectation
SC_UNORDERED_COLLECTION

425 Unordered Collection (WebDAV, RFC3648)

public static final HttpResponseExpectation
SC_UNPROCESSABLE_ENTITY

422 Unprocessable Entity (WebDAV, RFC4918)

public static final HttpResponseExpectation
SC_UNSUPPORTED_MEDIA_TYPE

415 Unsupported Media Type

public static final HttpResponseExpectation
SC_UPGRADE_REQUIRED

426 Upgrade Required (RFC2817)

public static final HttpResponseExpectation
SC_USE_PROXY

305 Use Proxy (since HTTP/1.1)

public static final HttpResponseExpectation
SC_VARIANT_ALSO_NEGOTIATES

506 Variant Also Negotiates (RFC2295)

Method Summary

Modifier and TypeMethod and Description
public static HttpResponseExpectation
contentType(String
the mime type
mimeType
)

Creates an expectation validating the response has a content-type header matching the mimeType.

public static HttpResponseExpectation
contentType(String...
the list of mime types
mimeTypes
)

Creates an expectation validating the response has a content-type header matching one of the mimeTypes.

public static HttpResponseExpectation
contentType(List<String>
the list of mime types
mimeTypes
)

Creates an expectation validating the response has a content-type header matching one of the mimeTypes.

public static HttpResponseExpectation
status(int
the expected status code
statusCode
)

Creates an expectation asserting that the status response code is equal to statusCode.

public static HttpResponseExpectation
status(int min, int max)

Inherited from io.vertx.core.Expectation:
anddescribeortestwrappingFailure

Field Detail

JSONback to summary
public static final HttpResponseExpectation JSON

Creates an expectation validating the response content-type is application/json.

SC_ACCEPTEDback to summary
public static final HttpResponseExpectation SC_ACCEPTED

202 Accepted

SC_BAD_GATEWAYback to summary
public static final HttpResponseExpectation SC_BAD_GATEWAY

502 Bad Gateway

SC_BAD_REQUESTback to summary
public static final HttpResponseExpectation SC_BAD_REQUEST

400 Bad Request

SC_CLIENT_ERRORSback to summary
public static final HttpResponseExpectation SC_CLIENT_ERRORS

Any 4XX client error

SC_CONFLICTback to summary
public static final HttpResponseExpectation SC_CONFLICT

409 Conflict

SC_CONTINUEback to summary
public static final HttpResponseExpectation SC_CONTINUE

100 Continue

SC_CREATEDback to summary
public static final HttpResponseExpectation SC_CREATED

201 Created

SC_EARLY_HINTSback to summary
public static final HttpResponseExpectation SC_EARLY_HINTS

103 Early Hints

SC_EXPECTATION_FAILEDback to summary
public static final HttpResponseExpectation SC_EXPECTATION_FAILED

417 Expectation Failed

SC_FAILED_DEPENDENCYback to summary
public static final HttpResponseExpectation SC_FAILED_DEPENDENCY

424 Failed Dependency (WebDAV, RFC4918)

SC_FORBIDDENback to summary
public static final HttpResponseExpectation SC_FORBIDDEN

403 Forbidden

SC_FOUNDback to summary
public static final HttpResponseExpectation SC_FOUND

302 Found

SC_GATEWAY_TIMEOUTback to summary
public static final HttpResponseExpectation SC_GATEWAY_TIMEOUT

504 Gateway Timeout

SC_GONEback to summary
public static final HttpResponseExpectation SC_GONE

410 Gone

SC_HTTP_VERSION_NOT_SUPPORTEDback to summary
public static final HttpResponseExpectation SC_HTTP_VERSION_NOT_SUPPORTED

505 HTTP Version Not Supported

SC_INFORMATIONAL_RESPONSEback to summary
public static final HttpResponseExpectation SC_INFORMATIONAL_RESPONSE

Any 1XX informational response

SC_INSUFFICIENT_STORAGEback to summary
public static final HttpResponseExpectation SC_INSUFFICIENT_STORAGE

507 Insufficient Storage (WebDAV, RFC4918)

SC_INTERNAL_SERVER_ERRORback to summary
public static final HttpResponseExpectation SC_INTERNAL_SERVER_ERROR

500 Internal Server Error

SC_LENGTH_REQUIREDback to summary
public static final HttpResponseExpectation SC_LENGTH_REQUIRED

411 Length Required

SC_LOCKEDback to summary
public static final HttpResponseExpectation SC_LOCKED

423 Locked (WebDAV, RFC4918)

SC_METHOD_NOT_ALLOWEDback to summary
public static final HttpResponseExpectation SC_METHOD_NOT_ALLOWED

405 Method Not Allowed

SC_MISDIRECTED_REQUESTback to summary
public static final HttpResponseExpectation SC_MISDIRECTED_REQUEST

421 Misdirected Request

SC_MOVED_PERMANENTLYback to summary
public static final HttpResponseExpectation SC_MOVED_PERMANENTLY

301 Moved Permanently

SC_MULTI_STATUSback to summary
public static final HttpResponseExpectation SC_MULTI_STATUS

207 Multi-Status (WebDAV, RFC2518)

SC_MULTIPLE_CHOICESback to summary
public static final HttpResponseExpectation SC_MULTIPLE_CHOICES

300 Multiple Choices

SC_NETWORK_AUTHENTICATION_REQUIREDback to summary
public static final HttpResponseExpectation SC_NETWORK_AUTHENTICATION_REQUIRED

511 Network Authentication Required (RFC6585)

SC_NO_CONTENTback to summary
public static final HttpResponseExpectation SC_NO_CONTENT

204 No Content

SC_NON_AUTHORITATIVE_INFORMATIONback to summary
public static final HttpResponseExpectation SC_NON_AUTHORITATIVE_INFORMATION

203 Non-Authoritative Information (since HTTP/1.1)

SC_NOT_ACCEPTABLEback to summary
public static final HttpResponseExpectation SC_NOT_ACCEPTABLE

406 Not Acceptable

SC_NOT_EXTENDEDback to summary
public static final HttpResponseExpectation SC_NOT_EXTENDED

510 Not Extended (RFC2774)

SC_NOT_FOUNDback to summary
public static final HttpResponseExpectation SC_NOT_FOUND

404 Not Found

SC_NOT_IMPLEMENTEDback to summary
public static final HttpResponseExpectation SC_NOT_IMPLEMENTED

501 Not Implemented

SC_NOT_MODIFIEDback to summary
public static final HttpResponseExpectation SC_NOT_MODIFIED

304 Not Modified

SC_OKback to summary
public static final HttpResponseExpectation SC_OK

200 OK

SC_PARTIAL_CONTENTback to summary
public static final HttpResponseExpectation SC_PARTIAL_CONTENT

206 Partial Content

SC_PAYMENT_REQUIREDback to summary
public static final HttpResponseExpectation SC_PAYMENT_REQUIRED

402 Payment Required

SC_PERMANENT_REDIRECTback to summary
public static final HttpResponseExpectation SC_PERMANENT_REDIRECT

308 Permanent Redirect (RFC7538)

SC_PRECONDITION_FAILEDback to summary
public static final HttpResponseExpectation SC_PRECONDITION_FAILED

412 Precondition Failed

SC_PRECONDITION_REQUIREDback to summary
public static final HttpResponseExpectation SC_PRECONDITION_REQUIRED

428 Precondition Required (RFC6585)

SC_PROCESSINGback to summary
public static final HttpResponseExpectation SC_PROCESSING

102 Processing (WebDAV, RFC2518)

SC_PROXY_AUTHENTICATION_REQUIREDback to summary
public static final HttpResponseExpectation SC_PROXY_AUTHENTICATION_REQUIRED

407 Proxy Authentication Required

SC_REDIRECTIONback to summary
public static final HttpResponseExpectation SC_REDIRECTION

Any 3XX redirection

SC_REQUEST_ENTITY_TOO_LARGEback to summary
public static final HttpResponseExpectation SC_REQUEST_ENTITY_TOO_LARGE

413 Request Entity Too Large

SC_REQUEST_HEADER_FIELDS_TOO_LARGEback to summary
public static final HttpResponseExpectation SC_REQUEST_HEADER_FIELDS_TOO_LARGE

431 Request Header Fields Too Large (RFC6585)

SC_REQUEST_TIMEOUTback to summary
public static final HttpResponseExpectation SC_REQUEST_TIMEOUT

408 Request Timeout

SC_REQUEST_URI_TOO_LONGback to summary
public static final HttpResponseExpectation SC_REQUEST_URI_TOO_LONG

414 Request-URI Too Long

SC_REQUESTED_RANGE_NOT_SATISFIABLEback to summary
public static final HttpResponseExpectation SC_REQUESTED_RANGE_NOT_SATISFIABLE

416 Requested Range Not Satisfiable

SC_RESET_CONTENTback to summary
public static final HttpResponseExpectation SC_RESET_CONTENT

205 Reset Content

SC_SEE_OTHERback to summary
public static final HttpResponseExpectation SC_SEE_OTHER

303 See Other (since HTTP/1.1)

SC_SERVER_ERRORSback to summary
public static final HttpResponseExpectation SC_SERVER_ERRORS

Any 5XX server error

SC_SERVICE_UNAVAILABLEback to summary
public static final HttpResponseExpectation SC_SERVICE_UNAVAILABLE

503 Service Unavailable

SC_SUCCESSback to summary
public static final HttpResponseExpectation SC_SUCCESS

Any 2XX success

SC_SWITCHING_PROTOCOLSback to summary
public static final HttpResponseExpectation SC_SWITCHING_PROTOCOLS

101 Switching Protocols

SC_TEMPORARY_REDIRECTback to summary
public static final HttpResponseExpectation SC_TEMPORARY_REDIRECT

307 Temporary Redirect (since HTTP/1.1)

SC_TOO_MANY_REQUESTSback to summary
public static final HttpResponseExpectation SC_TOO_MANY_REQUESTS

429 Too Many Requests (RFC6585)

SC_UNAUTHORIZEDback to summary
public static final HttpResponseExpectation SC_UNAUTHORIZED

401 Unauthorized

SC_UNORDERED_COLLECTIONback to summary
public static final HttpResponseExpectation SC_UNORDERED_COLLECTION

425 Unordered Collection (WebDAV, RFC3648)

SC_UNPROCESSABLE_ENTITYback to summary
public static final HttpResponseExpectation SC_UNPROCESSABLE_ENTITY

422 Unprocessable Entity (WebDAV, RFC4918)

SC_UNSUPPORTED_MEDIA_TYPEback to summary
public static final HttpResponseExpectation SC_UNSUPPORTED_MEDIA_TYPE

415 Unsupported Media Type

SC_UPGRADE_REQUIREDback to summary
public static final HttpResponseExpectation SC_UPGRADE_REQUIRED

426 Upgrade Required (RFC2817)

SC_USE_PROXYback to summary
public static final HttpResponseExpectation SC_USE_PROXY

305 Use Proxy (since HTTP/1.1)

SC_VARIANT_ALSO_NEGOTIATESback to summary
public static final HttpResponseExpectation SC_VARIANT_ALSO_NEGOTIATES

506 Variant Also Negotiates (RFC2295)

Method Detail

contentTypeback to summary
public static HttpResponseExpectation contentType(String mimeType)

Creates an expectation validating the response has a content-type header matching the mimeType.

Parameters
mimeType:String

the mime type

contentTypeback to summary
public static HttpResponseExpectation contentType(String... mimeTypes)

Creates an expectation validating the response has a content-type header matching one of the mimeTypes.

Parameters
mimeTypes:String[]

the list of mime types

contentTypeback to summary
public static HttpResponseExpectation contentType(List<String> mimeTypes)

Creates an expectation validating the response has a content-type header matching one of the mimeTypes.

Parameters
mimeTypes:List<String>

the list of mime types

statusback to summary
public static HttpResponseExpectation status(int statusCode)

Creates an expectation asserting that the status response code is equal to statusCode.

Parameters
statusCode:int

the expected status code

statusback to summary
public static HttpResponseExpectation status(int min, int max)