HttpRequestTestCase class
Constructors
-
HttpRequestTestCase.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 {}, List<String> tags = const [], AppliesTo? appliesTo, required String method, required String uri, String? host, String? resolvedHost, List<String> queryParams = const [], List<String> forbidQueryParams = const [], List<String> requireQueryParams = const []})
-
const
-
HttpRequestTestCase.fromJson(Map<String, Object?> json)
-
factory
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.
finalinherited
-
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.
finalinherited
-
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").
finalinherited
-
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.
finalinherited
-
documentation
→ String?
-
A description of the test and what is being asserted defined in
CommonMark.
finalinherited
-
A list of header field names that must not appear in the serialized HTTP
request.
finalinherited
-
forbidQueryParams
→ List<String>
-
A list of query string parameter names that must not appear in the
serialized HTTP request.
final
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
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.
finalinherited
-
host
→ String?
-
The host or endpoint provided as input used to generate the HTTP request
(for example, "example.com").
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.
finalinherited
-
method
→ String
-
The expected serialized HTTP request method.
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.
finalinherited
-
props
→ List<Object?>
-
The type's equatable properties.
no setteroverride
-
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.
finalinherited
-
queryParams
→ List<String>
-
A list of the expected serialized query string parameters.
final
-
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.
finalinherited
-
requireQueryParams
→ List<String>
-
A list of query string parameter names that MUST appear in the serialized
request URI, but no assertion is made on the value.
final
-
resolvedHost
→ String?
-
The expected host present in the Host header of the request, not including
the path or scheme (for example, "prefix.example.com"). If no resolvedHost
is defined, then no assertions are made about the resolved host for the
request.
final
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
tags
→ List<String>
-
Attaches a list of tags that allow test cases to be categorized and
grouped.
finalinherited
-
uri
→ String
-
The request-target of the HTTP request, not including the query string
(for example, "/foo/bar").
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.
finalinherited
-
vendorParamsShape
→ ShapeId?
-
A shape to be used to validate the vendorParams member contents.
finalinherited