Skip to content

Protocol tests parsed response validation #3414

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ AWS_PROTOCOL_TEST(EmptyInputAndEmptyOutput, Ec2QueryEmptyInputAndEmptyOutput) {
EmptyInputAndEmptyOutputRequest request;

auto outcome = client.EmptyInputAndEmptyOutput(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPUVtcHR5SW5wdXRBbmRFbXB0eU91dHB1dCZWZXJzaW9uPTIwMjAtMDEtMDg=";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ AWS_PROTOCOL_TEST(EndpointOperation, Ec2QueryEndpointTrait) {
EndpointOperationRequest request;

auto outcome = client.EndpointOperation(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPUVuZHBvaW50T3BlcmF0aW9uJlZlcnNpb249MjAyMC0wMS0wOA==";
expectedRq.uri = "/";
expectedRq.host = "foo.example.com";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@ AWS_PROTOCOL_TEST(EndpointWithHostLabelOperation, Ec2QueryEndpointTraitWithHostL
request.SetLabel(R"(bar)");

auto outcome = client.EndpointWithHostLabelOperation(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPUVuZHBvaW50V2l0aEhvc3RMYWJlbE9wZXJhdGlvbiZWZXJzaW9uPTIwMjAtMDEtMDgmTGFiZWw9YmFy";
expectedRq.uri = "/";
expectedRq.host = "foo.bar.example.com";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ AWS_PROTOCOL_TEST(HostWithPathOperation, Ec2QueryHostWithPath) {
HostWithPathOperationRequest request;

auto outcome = client.HostWithPathOperation(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPUhvc3RXaXRoUGF0aE9wZXJhdGlvbiZWZXJzaW9uPTIwMjAtMDEtMDg=";
expectedRq.uri = "/custom/";
expectedRq.host = "example.com/custom";
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ AWS_PROTOCOL_TEST(NestedStructures, Ec2NestedStructures) {
}

auto outcome = client.NestedStructures(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPU5lc3RlZFN0cnVjdHVyZXMmVmVyc2lvbj0yMDIwLTAxLTA4Jk5lc3RlZC5TdHJpbmdBcmc9Zm9vJk5lc3RlZC5PdGhlckFyZz10cnVlJk5lc3RlZC5SZWN1cnNpdmVBcmcuU3RyaW5nQXJnPWJheg==";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
expectedRq.requireHeaders = {"Content-Length"};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ AWS_PROTOCOL_TEST(NoInputAndOutput, Ec2QueryNoInputAndOutput) {
NoInputAndOutputRequest request;

auto outcome = client.NoInputAndOutput(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPU5vSW5wdXRBbmRPdXRwdXQmVmVyc2lvbj0yMDIwLTAxLTA4";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,12 @@ EcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr
)");

auto outcome = client.PutWithContentEncoding(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Encoding", R"(gzip)"}};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}

AWS_PROTOCOL_TEST(PutWithContentEncoding, SDKAppendsGzipAndIgnoresHttpProvidedEncoding_ec2Query) {
Expand Down Expand Up @@ -295,11 +294,10 @@ EcffzjixWU9FpAyGp2rVl4ETRgqljOGw4UgK31r0ZIEGnH0xGz1FtbW1OcQM008JVujRqulCucEMmntr
)");

auto outcome = client.PutWithContentEncoding(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Encoding", R"(gzip)"}};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ AWS_PROTOCOL_TEST(QueryIdempotencyTokenAutoFill, Ec2ProtocolIdempotencyTokenAuto
QueryIdempotencyTokenAutoFillRequest request;

auto outcome = client.QueryIdempotencyTokenAutoFill(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPVF1ZXJ5SWRlbXBvdGVuY3lUb2tlbkF1dG9GaWxsJlZlcnNpb249MjAyMC0wMS0wOCZUb2tlbj0wMDAwMDAwMC0wMDAwLTQwMDAtODAwMC0wMDAwMDAwMDAwMDA=";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
expectedRq.requireHeaders = {"Content-Length"};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}

AWS_PROTOCOL_TEST(QueryIdempotencyTokenAutoFill, Ec2ProtocolIdempotencyTokenAutoFillIsSet) {
Expand All @@ -39,13 +38,12 @@ AWS_PROTOCOL_TEST(QueryIdempotencyTokenAutoFill, Ec2ProtocolIdempotencyTokenAuto
request.SetToken(R"(00000000-0000-4000-8000-000000000123)");

auto outcome = client.QueryIdempotencyTokenAutoFill(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPVF1ZXJ5SWRlbXBvdGVuY3lUb2tlbkF1dG9GaWxsJlZlcnNpb249MjAyMC0wMS0wOCZUb2tlbj0wMDAwMDAwMC0wMDAwLTQwMDAtODAwMC0wMDAwMDAwMDAxMjM=";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
expectedRq.requireHeaders = {"Content-Length"};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}
15 changes: 5 additions & 10 deletions generated/protocol-tests/tests/input/ec2/tests/QueryListsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@ AWS_PROTOCOL_TEST(QueryLists, Ec2Lists) {
}

auto outcome = client.QueryLists(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPVF1ZXJ5TGlzdHMmVmVyc2lvbj0yMDIwLTAxLTA4Jkxpc3RBcmcuMT1mb28mTGlzdEFyZy4yPWJhciZMaXN0QXJnLjM9YmF6JkNvbXBsZXhMaXN0QXJnLjEuSGk9aGVsbG8mQ29tcGxleExpc3RBcmcuMi5IaT1ob2xh";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}

AWS_PROTOCOL_TEST(QueryLists, Ec2EmptyQueryLists) {
Expand All @@ -49,14 +48,13 @@ AWS_PROTOCOL_TEST(QueryLists, Ec2EmptyQueryLists) {
request.SetListArg({});

auto outcome = client.QueryLists(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPVF1ZXJ5TGlzdHMmVmVyc2lvbj0yMDIwLTAxLTA4";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}

AWS_PROTOCOL_TEST(QueryLists, Ec2ListArgWithXmlNameMember) {
Expand All @@ -68,14 +66,13 @@ AWS_PROTOCOL_TEST(QueryLists, Ec2ListArgWithXmlNameMember) {
request.SetListArgWithXmlNameMember({R"(A)", R"(B)"});

auto outcome = client.QueryLists(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPVF1ZXJ5TGlzdHMmVmVyc2lvbj0yMDIwLTAxLTA4Jkxpc3RBcmdXaXRoWG1sTmFtZU1lbWJlci4xPUEmTGlzdEFyZ1dpdGhYbWxOYW1lTWVtYmVyLjI9Qg==";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}

AWS_PROTOCOL_TEST(QueryLists, Ec2ListMemberWithXmlName) {
Expand All @@ -87,14 +84,13 @@ AWS_PROTOCOL_TEST(QueryLists, Ec2ListMemberWithXmlName) {
request.SetListArgWithXmlName({R"(A)", R"(B)"});

auto outcome = client.QueryLists(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPVF1ZXJ5TGlzdHMmVmVyc2lvbj0yMDIwLTAxLTA4JkhpLjE9QSZIaS4yPUI=";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}

AWS_PROTOCOL_TEST(QueryLists, Ec2ListNestedStructWithList) {
Expand All @@ -110,12 +106,11 @@ AWS_PROTOCOL_TEST(QueryLists, Ec2ListNestedStructWithList) {
}

auto outcome = client.QueryLists(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPVF1ZXJ5TGlzdHMmVmVyc2lvbj0yMDIwLTAxLTA4Jk5lc3RlZFdpdGhMaXN0Lkxpc3RBcmcuMT1BJk5lc3RlZFdpdGhMaXN0Lkxpc3RBcmcuMj1C";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ AWS_PROTOCOL_TEST(QueryTimestamps, Ec2TimestampsInput) {
request.SetEpochTarget(Aws::Utils::DateTime(1422172800L));

auto outcome = client.QueryTimestamps(request);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();

ExpectedRequest expectedRq;
expectedRq.method = "POST";
expectedRq.body = "QWN0aW9uPVF1ZXJ5VGltZXN0YW1wcyZWZXJzaW9uPTIwMjAtMDEtMDgmTm9ybWFsRm9ybWF0PTIwMTUtMDEtMjVUMDglM0EwMCUzQTAwWiZFcG9jaE1lbWJlcj0xNDIyMTcyODAwJkVwb2NoVGFyZ2V0PTE0MjIxNzI4MDA=";
expectedRq.uri = "/";
expectedRq.headers = {{"Content-Type", R"(application/x-www-form-urlencoded)"}};
expectedRq.requireHeaders = {"Content-Length"};
ValidateRequestSent(expectedRq);
AWS_ASSERT_SUCCESS(outcome) << outcome.GetError();
}
Loading