Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate protocol tests to new operation syntax #260

Merged
merged 1 commit into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use smithy.test#httpResponseTests
/// no request or response payload because the operation has no input or output.
///
/// While this should be rare, code generators must support this.
operation NoInputAndNoOutput()
operation NoInputAndNoOutput {}

apply NoInputAndNoOutput @httpRequestTests([
{
Expand Down Expand Up @@ -44,7 +44,9 @@ apply NoInputAndNoOutput @httpResponseTests([
/// no request payload or response members.
///
/// While this should be rare, code generators must support this.
operation NoInputAndOutput() -> NoInputAndOutputOutput
operation NoInputAndOutput {
input: NoInputAndOutputOutput
}

apply NoInputAndOutput @httpRequestTests([
{
Expand Down Expand Up @@ -78,7 +80,10 @@ structure NoInputAndOutputOutput {}
/// no request or response members.
///
/// While this should be rare, code generators must support this.
operation EmptyInputAndEmptyOutput(EmptyInputAndEmptyOutputInput) -> EmptyInputAndEmptyOutputOutput
operation EmptyInputAndEmptyOutput {
input: EmptyInputAndEmptyOutputInput,
output: EmptyInputAndEmptyOutputOutput
}

apply EmptyInputAndEmptyOutput @httpRequestTests([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ use aws.protocols.tests.shared#StringList
use smithy.test#httpRequestTests

/// This test serializes simple and complex lists.
operation QueryLists(QueryListsInput)
operation QueryLists {
input: QueryListsInput
}

apply QueryLists @httpRequestTests([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ use aws.protocols.tests.shared#StringMap
use smithy.test#httpRequestTests

/// This test serializes simple and complex maps.
operation QueryMaps(QueryMapsInput)
operation QueryMaps {
input: QueryMapsInput
}

apply QueryMaps @httpRequestTests([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use aws.protocols.tests.shared#FooEnum
use smithy.test#httpRequestTests

/// This test serializes strings, numbers, and boolean values.
operation SimpleInputParams(SimpleInputParamsInput)
operation SimpleInputParams {
input: SimpleInputParamsInput
}

apply SimpleInputParams @httpRequestTests([
{
Expand Down Expand Up @@ -159,7 +161,9 @@ structure SimpleInputParamsInput {
/// 1. Timestamps are serialized as RFC 3339 date-time values by default.
/// 2. A timestampFormat trait on a member changes the format.
/// 3. A timestampFormat trait on the shape targeted by the member changes the format.
operation QueryTimestamps(QueryTimestampsInput)
operation QueryTimestamps {
input: QueryTimestampsInput
}

apply QueryTimestamps @httpRequestTests([
{
Expand Down Expand Up @@ -201,7 +205,9 @@ structure QueryTimestampsInput {
}

/// This test serializes nested and recursive structure members.
operation NestedStructures(NestedStructuresInput)
operation NestedStructures {
input: NestedStructuresInput
}

apply NestedStructures @httpRequestTests([
{
Expand Down Expand Up @@ -244,7 +250,9 @@ structure StructArg {

/// Automatically adds idempotency tokens.
@tags(["client-only"])
operation QueryIdempotencyTokenAutoFill(QueryIdempotencyTokenAutoFillInput)
operation QueryIdempotencyTokenAutoFill {
input: QueryIdempotencyTokenAutoFillInput
}

apply QueryIdempotencyTokenAutoFill @httpRequestTests([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ use smithy.test#httpResponseTests
/// 1. A successful response in the form of GreetingWithErrorsOutput
/// 2. An InvalidGreeting error.
/// 3. A BadRequest error.
operation GreetingWithErrors() -> GreetingWithErrorsOutput errors [InvalidGreeting, ComplexError]
operation GreetingWithErrors {
output: GreetingWithErrorsOutput,
errors: [InvalidGreeting, ComplexError]
}

apply GreetingWithErrors @httpResponseTests([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ use smithy.test#httpResponseTests
/// 5. Flattened XML lists.
/// 6. Flattened XML lists with @xmlName.
/// 7. Lists of structures.
operation XmlLists() -> XmlListsOutput
operation XmlLists {
output: XmlListsOutput
}

apply XmlLists @httpResponseTests([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use aws.protocols.tests.shared#GreetingStruct
use smithy.test#httpResponseTests

/// The example tests basic map serialization.
operation XmlMaps() -> XmlMapsOutput
operation XmlMaps {
output: XmlMapsOutput
}

apply XmlMaps @httpResponseTests([
{
Expand Down Expand Up @@ -64,7 +66,9 @@ map XmlMapsOutputMap {
}

// This example tests maps with @xmlName on members.
operation XmlMapsXmlName() -> XmlMapsXmlNameOutput
operation XmlMapsXmlName {
output: XmlMapsXmlNameOutput
}

apply XmlMapsXmlName @httpResponseTests([
{
Expand Down Expand Up @@ -122,7 +126,9 @@ map XmlMapsXmlNameOutputMap {
}

/// Flattened maps
operation FlattenedXmlMap() -> FlattenedXmlMapOutput
operation FlattenedXmlMap {
output: FlattenedXmlMapOutput
}

apply FlattenedXmlMap @httpResponseTests([
{
Expand Down Expand Up @@ -162,7 +168,9 @@ structure FlattenedXmlMapOutput {
}

/// Flattened maps with @xmlName
operation FlattenedXmlMapWithXmlName() -> FlattenedXmlMapWithXmlNameOutput
operation FlattenedXmlMapWithXmlName {
output: FlattenedXmlMapWithXmlNameOutput
}

apply FlattenedXmlMapWithXmlName @httpResponseTests([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ use smithy.test#httpResponseTests

// This example serializes simple scalar types in the top level XML document.
// Note that headers are not serialized in the payload.
operation SimpleScalarXmlProperties() -> SimpleScalarXmlPropertiesOutput
operation SimpleScalarXmlProperties {
output: SimpleScalarXmlPropertiesOutput
}

apply SimpleScalarXmlProperties @httpResponseTests([
{
Expand Down Expand Up @@ -71,7 +73,9 @@ structure SimpleScalarXmlPropertiesOutput {
}

/// Blobs are base64 encoded
operation XmlBlobs() -> XmlBlobsOutput
operation XmlBlobs {
output: XmlBlobsOutput
}

apply XmlBlobs @httpResponseTests([
{
Expand Down Expand Up @@ -103,7 +107,9 @@ structure XmlBlobsOutput {
/// This tests how timestamps are serialized, including using the
/// default format of date-time and various @timestampFormat trait
/// values.
operation XmlTimestamps() -> XmlTimestampsOutput
operation XmlTimestamps {
output: XmlTimestampsOutput
}

apply XmlTimestamps @httpResponseTests([
{
Expand Down Expand Up @@ -202,7 +208,9 @@ structure XmlTimestampsOutput {
}

/// This example serializes enums as top level properties, in lists, sets, and maps.
operation XmlEnums() -> XmlEnumsOutput
operation XmlEnums {
output: XmlEnumsOutput
}

apply XmlEnums @httpResponseTests([
{
Expand Down Expand Up @@ -265,7 +273,9 @@ structure XmlEnumsOutput {
}

/// Recursive shapes
operation RecursiveXmlShapes() -> RecursiveXmlShapesOutput
operation RecursiveXmlShapes {
output: RecursiveXmlShapesOutput
}

apply RecursiveXmlShapes @httpResponseTests([
{
Expand Down Expand Up @@ -327,7 +337,9 @@ structure RecursiveXmlShapesOutputNested2 {
}

// XML namespace
operation XmlNamespaces() -> XmlNamespacesOutput
operation XmlNamespaces {
output: XmlNamespacesOutput
}

apply XmlNamespaces @httpResponseTests([
{
Expand Down Expand Up @@ -390,7 +402,9 @@ list XmlNamespacedList {
///
/// The wrapping element is always operation name + "Response", and
/// inside of that wrapper is another wrapper named operation name + "Result".
operation IgnoresWrappingXmlName() -> IgnoresWrappingXmlNameOutput
operation IgnoresWrappingXmlName {
output: IgnoresWrappingXmlNameOutput
}

apply IgnoresWrappingXmlName @httpResponseTests([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use smithy.test#httpResponseTests
/// no request or response payload because the operation has no input or output.
/// While this should be rare, code generators must support this.
@http(uri: "/NoInputAndNoOutput", method: "POST")
operation NoInputAndNoOutput()
operation NoInputAndNoOutput {}

apply NoInputAndNoOutput @httpRequestTests([
{
Expand All @@ -40,7 +40,9 @@ apply NoInputAndNoOutput @httpResponseTests([
/// output is empty. While this should be rare, code generators must support
/// this.
@http(uri: "/NoInputAndOutputOutput", method: "POST")
operation NoInputAndOutput() -> NoInputAndOutputOutput
operation NoInputAndOutput {
output: NoInputAndOutputOutput
}

apply NoInputAndOutput @httpRequestTests([
{
Expand Down Expand Up @@ -68,7 +70,10 @@ structure NoInputAndOutputOutput {}
/// and empty output structure that reuses the same shape. While this should
/// be rare, code generators must support this.
@http(uri: "/EmptyInputAndEmptyOutput", method: "POST")
operation EmptyInputAndEmptyOutput(EmptyInputAndEmptyOutputInput) -> EmptyInputAndEmptyOutputOutput
operation EmptyInputAndEmptyOutput {
input: EmptyInputAndEmptyOutputInput,
output: EmptyInputAndEmptyOutputOutput
}

apply EmptyInputAndEmptyOutput @httpRequestTests([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ use smithy.test#httpResponseTests
/// the presence of the
@idempotent
@http(uri: "/GreetingWithErrors", method: "PUT")
operation GreetingWithErrors() -> GreetingWithErrorsOutput errors [InvalidGreeting, ComplexError, FooError]
operation GreetingWithErrors {
output: GreetingWithErrorsOutput,
errors: [InvalidGreeting, ComplexError, FooError]
}

apply GreetingWithErrors @httpResponseTests([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ use smithy.test#httpResponseTests
/// The example tests how requests and responses are serialized when there is
/// no input or output payload but there are HTTP header bindings.
@http(uri: "/InputAndOutputWithHeaders", method: "POST")
operation InputAndOutputWithHeaders(InputAndOutputWithHeadersIO) -> InputAndOutputWithHeadersIO
operation InputAndOutputWithHeaders {
input: InputAndOutputWithHeadersIO,
output: InputAndOutputWithHeadersIO
}

apply InputAndOutputWithHeaders @httpRequestTests([
{
Expand Down Expand Up @@ -260,7 +263,10 @@ structure InputAndOutputWithHeadersIO {
/// Null and empty headers are not sent over the wire.
@readonly
@http(uri: "/NullAndEmptyHeaders", method: "GET")
operation NullAndEmptyHeaders(NullAndEmptyHeadersIO) -> NullAndEmptyHeadersIO
operation NullAndEmptyHeaders {
input: NullAndEmptyHeadersIO,
output: NullAndEmptyHeadersIO
}

apply NullAndEmptyHeaders @httpRequestTests([
{
Expand Down Expand Up @@ -308,7 +314,10 @@ structure NullAndEmptyHeadersIO {

/// The example tests how timestamp request and response headers are serialized.
@http(uri: "/TimestampFormatHeaders", method: "POST")
operation TimestampFormatHeaders(TimestampFormatHeadersIO) -> TimestampFormatHeadersIO
operation TimestampFormatHeaders {
input: TimestampFormatHeadersIO,
output: TimestampFormatHeadersIO
}

apply TimestampFormatHeaders @httpRequestTests([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ use smithy.test#httpResponseTests
/// payload but there are HTTP labels.
@readonly
@http(method: "GET", uri: "/HttpRequestWithLabels/{string}/{short}/{integer}/{long}/{float}/{double}/{boolean}/{timestamp}")
operation HttpRequestWithLabels(HttpRequestWithLabelsInput)
operation HttpRequestWithLabels {
input: HttpRequestWithLabelsInput
}

apply HttpRequestWithLabels @httpRequestTests([
{
Expand Down Expand Up @@ -77,7 +79,9 @@ structure HttpRequestWithLabelsInput {
/// URI path.
@readonly
@http(method: "GET", uri: "/HttpRequestWithLabelsAndTimestampFormat/{memberEpochSeconds}/{memberHttpDate}/{memberDateTime}/{defaultFormat}/{targetEpochSeconds}/{targetHttpDate}/{targetDateTime}")
operation HttpRequestWithLabelsAndTimestampFormat(HttpRequestWithLabelsAndTimestampFormatInput)
operation HttpRequestWithLabelsAndTimestampFormat {
input: HttpRequestWithLabelsAndTimestampFormatInput
}

apply HttpRequestWithLabelsAndTimestampFormat @httpRequestTests([
{
Expand Down Expand Up @@ -143,7 +147,9 @@ structure HttpRequestWithLabelsAndTimestampFormatInput {
// This example uses a greedy label and a normal label.
@readonly
@http(method: "GET", uri: "/HttpRequestWithGreedyLabelInPath/foo/{foo}/baz/{baz+}")
operation HttpRequestWithGreedyLabelInPath(HttpRequestWithGreedyLabelInPathInput)
operation HttpRequestWithGreedyLabelInPath {
input: HttpRequestWithGreedyLabelInPathInput
}

apply HttpRequestWithGreedyLabelInPath @httpRequestTests([
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ use smithy.test#httpResponseTests
/// In this example, no JSON document is synthesized because the payload is
/// not a structure or a union type.
@http(uri: "/HttpPayloadTraits", method: "POST")
operation HttpPayloadTraits(HttpPayloadTraitsInputOutput) -> HttpPayloadTraitsInputOutput
operation HttpPayloadTraits {
input: HttpPayloadTraitsInputOutput,
output: HttpPayloadTraitsInputOutput
}

apply HttpPayloadTraits @httpRequestTests([
{
Expand Down Expand Up @@ -89,7 +92,10 @@ structure HttpPayloadTraitsInputOutput {
/// This examples uses a `@mediaType` trait on the payload to force a custom
/// content-type to be serialized.
@http(uri: "/HttpPayloadTraitsWithMediaType", method: "POST")
operation HttpPayloadTraitsWithMediaType(HttpPayloadTraitsWithMediaTypeInputOutput) -> HttpPayloadTraitsWithMediaTypeInputOutput
operation HttpPayloadTraitsWithMediaType {
input: HttpPayloadTraitsWithMediaTypeInputOutput,
output: HttpPayloadTraitsWithMediaTypeInputOutput
}

apply HttpPayloadTraitsWithMediaType @httpRequestTests([
{
Expand Down Expand Up @@ -142,7 +148,10 @@ structure HttpPayloadTraitsWithMediaTypeInputOutput {
/// to match the targeted structure.
@idempotent
@http(uri: "/HttpPayloadWithStructure", method: "PUT")
operation HttpPayloadWithStructure(HttpPayloadWithStructureInputOutput) -> HttpPayloadWithStructureInputOutput
operation HttpPayloadWithStructure {
input: HttpPayloadWithStructureInputOutput,
output: HttpPayloadWithStructureInputOutput
}

apply HttpPayloadWithStructure @httpRequestTests([
{
Expand Down
Loading