HttpRequestTestCase

smithy.test.HttpRequestTestCase
See theHttpRequestTestCase companion object
final case class HttpRequestTestCase(id: String, protocol: String, method: String, uri: String, host: Option[String], resolvedHost: Option[String], authScheme: Option[String], queryParams: Option[List[String]], forbidQueryParams: Option[List[String]], requireQueryParams: Option[List[String]], headers: Option[Map[String, String]], forbidHeaders: Option[List[String]], requireHeaders: Option[List[String]], body: Option[String], bodyMediaType: Option[String], params: Option[Document], vendorParams: Option[Document], vendorParamsShape: Option[String], documentation: Option[String], tags: Option[List[NonEmptyString]], appliesTo: Option[AppliesTo])

Value parameters

appliesTo

Indicates that the test case is only to be implemented by "client" or "server" implementations. This property is useful for identifying and testing edge cases of clients and servers that are impossible or undesirable to test in both client and server implementations.

authScheme

The optional authentication scheme shape ID to assume. It's possible that specific authentication schemes might influence the serialization logic of an HTTP request.

body

The expected HTTP message body. If no request body is defined, then no assertions are made about the body of the message.

bodyMediaType

The media type of the body. This is used to help test runners to parse and validate the expected data against generated data.

documentation

A description of the test and what is being asserted.

forbidHeaders

A list of header field names that must not appear in the serialized HTTP request.

forbidQueryParams

A list of query string parameter names that must not appear in the serialized HTTP request. Each value MUST appear in the format in which it is sent over the wire; if a key needs to be percent-encoded, then it MUST appear percent-encoded in this list.

headers

Defines a map of expected HTTP headers. Headers that are not listed in this map are ignored unless they are explicitly forbidden through forbidHeaders.

host

The host / endpoint provided to the client, not including the path or scheme (for example, "example.com").

id

The identifier of the test case. This identifier can be used by protocol test implementations to filter out unsupported test cases by ID, to generate test case names, etc. The provided id MUST match Smithy's identifier ABNF. No two httpRequestTests test cases can share the same ID.

method

The expected serialized HTTP request method.

params

Defines the input parameters used to generated the HTTP request. These parameters MUST be compatible with the input of the operation.

protocol

The name of the protocol to test.

queryParams

A list of the expected serialized query string parameters. Each element in the list is a query string key value pair that starts with the query string parameter name optionally followed by "=", optionally followed by the query string parameter value. For example, "foo=bar", "foo=", and "foo" are all valid values. The query string parameter name and the value MUST appear in the format in which it is expected to be sent over the wire; if a key or value needs to be percent-encoded, then it MUST appear percent-encoded in this list. A serialized HTTP request is not in compliance with the protocol if any query string parameter defined in queryParams is not defined in the request or if the value of a query string parameter in the request differs from the expected value. queryParams applies no constraints on additional query parameters.

requireHeaders

A list of header field names that must appear in the serialized HTTP message, but no assertion is made on the value. Headers listed in headers do not need to appear in this list.

requireQueryParams

A list of query string parameter names that MUST appear in the serialized request URI, but no assertion is made on the value. Each value MUST appear in the format in which it is sent over the wire; if a key needs to be percent-encoded, then it MUST appear percent-encoded in this list.

resolvedHost

The host / endpoint that the client should send to, not including the path or scheme (for example, "prefix.example.com"). This can differ from the host provided to the client if the hostPrefix member of the endpoint trait is set, for instance.

tags

Applies a list of tags to the test.

uri

The request-target of the HTTP request, not including the query string (for example, "/foo/bar").

vendorParams

Defines vendor-specific parameters that are used to influence the request. For example, some vendors might utilize environment variables, configuration files on disk, or other means to influence the serialization formats used by clients or servers. If a vendorParamsShape is set, these parameters MUST be compatible with that shape's definition.

vendorParamsShape

A shape to be used to validate the vendorParams member contents. If set, the parameters in vendorParams MUST be compatible with this shape's definition.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product