HttpMessageTestCase<T extends HttpMessageTestCase<T> > class
abstract
Defines how an HTTP request is serialized given a specific protocol, authentication scheme, and set of input parameters.
- Implementers
Constructors
-
HttpMessageTestCase.new({required String id, String? documentation, required ShapeId protocol, ShapeId? authScheme, String? body, String? bodyMediaType, Map<
String, Object?> params = const {}, ShapeId? vendorParamsShape, Map<String, Object?> vendorParams = const {}, Map<String, String> headers = const {}, List<String> forbidHeaders = const [], List<String> requireHeaders = const [], List<String> tags = const [], AppliesTo? appliesTo}) -
const
Properties
- appliesTo → 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. For
example, a "server" test might be useful to ensure a service can
gracefully receive a request that optionally contains a payload.
final
- authScheme → ShapeId?
-
A shape ID that specifies the optional authentication scheme to assume.
It's possible that specific authentication schemes might influence the
serialization logic of an HTTP request. The targeted shape MUST be marked
with the AuthDefinitionTrait trait.
final
- body → String?
-
The expected HTTP message body. If no request body is defined, then no
assertions are made about the body of the message. Because the body
parameter is a string, binary data MUST be represented in body by base64
encoding the data (for example, use "Zm9vCg==" and not "foo").
final
- bodyMediaType → String?
-
The media type of the body. This is used to help test runners to parse
and validate the expected data against generated data.
final
- documentation → String?
-
A description of the test and what is being asserted defined in
CommonMark.
final
-
forbidHeaders
→ List<
String> -
A list of header field names that must not appear in the serialized HTTP
request.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> -
A map of expected HTTP headers. Each key represents a header field name
and each value represents the expected header value. An HTTP request is
not in compliance with the protocol if any listed header is missing from
the serialized request or if the expected header value differs from the
serialized request value.
final
- id → String
-
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
smithy:identifier ABNF. No two httpRequestTests test cases can share the
same ID.
final
-
params
→ Map<
String, Object?> -
Defines the input parameters used to generate the HTTP request. These
parameters MUST be compatible with the input of the operation.
final
-
props
→ List<
Object?> -
The type's equatable properties.
no setter
- protocol → ShapeId
-
A shape ID that targets a shape marked with the protocolDefinition trait.
Because Smithy services can support multiple protocols, each test MUST
specify which protocol is under test.
final
-
requireHeaders
→ List<
String> -
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.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
Attaches a list of tags that allow test cases to be categorized and
grouped.
final
-
vendorParams
→ Map<
String, Object?> -
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.
final
- vendorParamsShape → ShapeId?
-
A shape to be used to validate the vendorParams member contents.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Object? -
Serializes
this
as a JSON object.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited