From 4eac16f054596f934b6e7f62222c06853c4d7525 Mon Sep 17 00:00:00 2001 From: George Fu Date: Wed, 30 Apr 2025 16:41:52 -0400 Subject: [PATCH 1/3] chore(codegen): sync for improved protocol test messages --- scripts/generate-clients/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/generate-clients/config.js b/scripts/generate-clients/config.js index 80ce32c17e2b..3f0e7a6861ff 100644 --- a/scripts/generate-clients/config.js +++ b/scripts/generate-clients/config.js @@ -1,7 +1,7 @@ // Update this commit when taking up new changes from smithy-typescript. module.exports = { // Use full commit hash as we explicitly fetch it. - SMITHY_TS_COMMIT: "3db70fad42c143dd53f535089166531836b440e6", + SMITHY_TS_COMMIT: "881e4fe5f60b5f1fb2530e6b7b9ba5095d4d6213", }; if (module.exports.SMITHY_TS_COMMIT.length < 40) { From 947662f0ce16a95cea9558fd2cd634ae7069a3d1 Mon Sep 17 00:00:00 2001 From: George Fu Date: Wed, 30 Apr 2025 16:46:18 -0400 Subject: [PATCH 2/3] chore: codegen --- private/aws-protocoltests-ec2/package.json | 3 +- .../test/functional/ec2query.spec.ts | 305 ++-- private/aws-protocoltests-ec2/vite.config.js | 8 + .../aws-protocoltests-json-10/package.json | 3 +- .../test/functional/awsjson1_0.spec.ts | 203 +-- .../aws-protocoltests-json-10/vite.config.js | 8 + .../package.json | 3 +- .../test/functional/awsjson1_1.spec.ts | 5 +- .../vite.config.js | 8 + private/aws-protocoltests-json/package.json | 3 +- .../test/functional/awsjson1_1.spec.ts | 582 ++++--- private/aws-protocoltests-json/vite.config.js | 8 + private/aws-protocoltests-query/package.json | 3 +- .../test/functional/awsquery.spec.ts | 362 +++-- .../aws-protocoltests-query/vite.config.js | 8 + .../package.json | 3 +- .../test/functional/restjson1.spec.ts | 2 +- .../vite.config.js | 8 + .../package.json | 3 +- .../test/functional/restjson1.spec.ts | 13 +- .../vite.config.js | 8 + .../aws-protocoltests-restjson/package.json | 3 +- .../test/functional/restjson1.spec.ts | 813 ++++++---- .../aws-protocoltests-restjson/vite.config.js | 8 + .../aws-protocoltests-restxml/package.json | 3 +- .../test/functional/restxml.spec.ts | 628 +++++--- .../aws-protocoltests-restxml/vite.config.js | 8 + .../package.json | 3 +- .../test/functional/rpcv2cbor.spec.ts | 448 +++--- .../vite.config.js | 8 + private/aws-restjson-server/package.json | 3 +- .../test/functional/restjson1.spec.ts | 1349 +++++++---------- private/aws-restjson-server/vite.config.js | 8 + .../package.json | 3 +- .../test/functional/restjson1.spec.ts | 381 ++--- .../vite.config.js | 8 + scripts/generate-clients/config.js | 2 +- yarn.lock | 160 +- 38 files changed, 3013 insertions(+), 2372 deletions(-) create mode 100644 private/aws-protocoltests-ec2/vite.config.js create mode 100644 private/aws-protocoltests-json-10/vite.config.js create mode 100644 private/aws-protocoltests-json-machinelearning/vite.config.js create mode 100644 private/aws-protocoltests-json/vite.config.js create mode 100644 private/aws-protocoltests-query/vite.config.js create mode 100644 private/aws-protocoltests-restjson-apigateway/vite.config.js create mode 100644 private/aws-protocoltests-restjson-glacier/vite.config.js create mode 100644 private/aws-protocoltests-restjson/vite.config.js create mode 100644 private/aws-protocoltests-restxml/vite.config.js create mode 100644 private/aws-protocoltests-smithy-rpcv2-cbor/vite.config.js create mode 100644 private/aws-restjson-server/vite.config.js create mode 100644 private/aws-restjson-validation-server/vite.config.js diff --git a/private/aws-protocoltests-ec2/package.json b/private/aws-protocoltests-ec2/package.json index 5edcb559a1a0..4d573f6427d7 100644 --- a/private/aws-protocoltests-ec2/package.json +++ b/private/aws-protocoltests-ec2/package.json @@ -64,7 +64,8 @@ "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "vitest": "2.1.8" }, "engines": { "node": ">=18.0.0" diff --git a/private/aws-protocoltests-ec2/test/functional/ec2query.spec.ts b/private/aws-protocoltests-ec2/test/functional/ec2query.spec.ts index 74ec6870cb55..df8e95e3aec2 100644 --- a/private/aws-protocoltests-ec2/test/functional/ec2query.spec.ts +++ b/private/aws-protocoltests-ec2/test/functional/ec2query.spec.ts @@ -3,6 +3,7 @@ import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { Encoder as __Encoder } from "@smithy/types"; import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; import { Readable } from "stream"; +import { expect, test as it } from "vitest"; import { DatetimeOffsetsCommand } from "../../src/commands/DatetimeOffsetsCommand"; import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; @@ -263,7 +264,10 @@ it("Ec2QueryDateTimeWithNegativeOffset:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -305,7 +309,10 @@ it("Ec2QueryDateTimeWithPositiveOffset:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -333,10 +340,9 @@ it("Ec2QueryEmptyInputAndEmptyOutput:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=EmptyInputAndEmptyOutput&Version=2020-01-08`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -401,13 +407,11 @@ it("Ec2QueryEndpointTrait:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("foo.example.com"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=EndpointOperation&Version=2020-01-08`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -443,13 +447,11 @@ it("Ec2QueryEndpointTraitWithHostLabel:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("foo.bar.example.com"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=EndpointWithHostLabelOperation&Version=2020-01-08&Label=bar`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -494,7 +496,10 @@ it("Ec2QueryDateTimeWithFractionalSeconds:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -536,7 +541,10 @@ it("Ec2GreetingWithErrors:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -585,7 +593,10 @@ it("Ec2InvalidGreetingError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -641,7 +652,10 @@ it("Ec2ComplexError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -673,7 +687,7 @@ it("Ec2QueryHostWithPath:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/custom/"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=HostWithPathOperation&Version=2020-01-08`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -718,7 +732,10 @@ it("Ec2IgnoresWrappingXmlName:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -753,12 +770,14 @@ it("Ec2NestedStructures:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=NestedStructures&Version=2020-01-08&Nested.StringArg=foo&Nested.OtherArg=true&Nested.RecursiveArg.StringArg=baz`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -789,10 +808,9 @@ it("Ec2QueryNoInputAndOutput:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=NoInputAndOutput&Version=2020-01-08`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -857,7 +875,6 @@ it("SDKAppliedContentEncoding_ec2Query:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-encoding"]).toBeDefined(); expect(r.headers["content-encoding"]).toBe("gzip"); } }); @@ -891,7 +908,6 @@ it("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_ec2Query:Request", async () => expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-encoding"]).toBeDefined(); expect(r.headers["content-encoding"]).toBe("gzip"); } }); @@ -920,12 +936,14 @@ it("Ec2ProtocolIdempotencyTokenAutoFill:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryIdempotencyTokenAutoFill&Version=2020-01-08&Token=00000000-0000-4000-8000-000000000000`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -957,12 +975,14 @@ it("Ec2ProtocolIdempotencyTokenAutoFillIsSet:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryIdempotencyTokenAutoFill&Version=2020-01-08&Token=00000000-0000-4000-8000-000000000123`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1003,10 +1023,9 @@ it("Ec2Lists:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryLists&Version=2020-01-08&ListArg.1=foo&ListArg.2=bar&ListArg.3=baz&ComplexListArg.1.Hi=hello&ComplexListArg.2.Hi=hola`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1039,10 +1058,9 @@ it("Ec2EmptyQueryLists:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryLists&Version=2020-01-08`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1075,10 +1093,9 @@ it("Ec2ListArgWithXmlNameMember:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryLists&Version=2020-01-08&ListArgWithXmlNameMember.1=A&ListArgWithXmlNameMember.2=B`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1111,10 +1128,9 @@ it("Ec2ListMemberWithXmlName:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryLists&Version=2020-01-08&Hi.1=A&Hi.2=B`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1149,10 +1165,9 @@ it("Ec2ListNestedStructWithList:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryLists&Version=2020-01-08&NestedWithList.ListArg.1=A&NestedWithList.ListArg.2=B`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1186,12 +1201,14 @@ it("Ec2TimestampsInput:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryTimestamps&Version=2020-01-08&NormalFormat=2015-01-25T08%3A00%3A00Z&EpochMember=1422172800&EpochTarget=1422172800`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1258,7 +1275,10 @@ it("Ec2RecursiveShapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1288,12 +1308,14 @@ it("Ec2SimpleInputParamsStrings:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Foo=val1&Bar=val2`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1326,12 +1348,14 @@ it("Ec2SimpleInputParamsStringAndBooleanTrue:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Foo=val1&Baz=true`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1363,12 +1387,14 @@ it("Ec2SimpleInputParamsStringsAndBooleanFalse:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Baz=false`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1400,12 +1426,14 @@ it("Ec2SimpleInputParamsInteger:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Bam=10`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1437,12 +1465,14 @@ it("Ec2SimpleInputParamsFloat:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Boo=10.8`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1474,12 +1504,14 @@ it("Ec2SimpleInputParamsBlob:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Qux=dmFsdWU%3D`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1511,12 +1543,14 @@ it("Ec2Enums:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FooEnum=Foo`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1548,12 +1582,14 @@ it("Ec2Query:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&HasQueryName=Hi`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1585,12 +1621,14 @@ it("Ec2QueryIsPreferred:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&HasQueryAndXmlName=Hi`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1622,12 +1660,14 @@ it("Ec2XmlNameIsUppercased:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&UsesXmlName=Hi`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1660,12 +1700,14 @@ it("Ec2QuerySupportsNaNFloatInputs:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FloatValue=NaN&Boo=NaN`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1698,12 +1740,14 @@ it("Ec2QuerySupportsInfinityFloatInputs:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FloatValue=Infinity&Boo=Infinity`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1736,12 +1780,14 @@ it("Ec2QuerySupportsNegativeInfinityFloatInputs:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FloatValue=-Infinity&Boo=-Infinity`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1804,7 +1850,10 @@ it("Ec2SimpleScalarProperties:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1847,7 +1896,10 @@ it("Ec2QuerySupportsNaNFloatOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1890,7 +1942,10 @@ it("Ec2QuerySupportsInfinityFloatOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1933,7 +1988,10 @@ it("Ec2QuerySupportsNegativeInfinityFloatOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1975,7 +2033,10 @@ it("Ec2XmlBlobs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2017,7 +2078,10 @@ it("Ec2XmlEmptyBlobs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2059,7 +2123,10 @@ it("Ec2XmlEmptySelfClosedBlobs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2102,7 +2169,10 @@ it("Ec2XmlEmptyLists:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2172,7 +2242,10 @@ it("Ec2XmlEnums:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2242,7 +2315,10 @@ it("Ec2XmlIntEnums:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2368,7 +2444,10 @@ it("Ec2XmlLists:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2419,7 +2498,10 @@ it("Ec2XmlNamespaces:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2461,7 +2543,10 @@ it("Ec2XmlTimestamps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2503,7 +2588,10 @@ it("Ec2XmlTimestampsWithDateTimeFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2545,7 +2633,10 @@ it("Ec2XmlTimestampsWithDateTimeOnTargetFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2587,7 +2678,10 @@ it("Ec2XmlTimestampsWithEpochSecondsFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2629,7 +2723,10 @@ it("Ec2XmlTimestampsWithEpochSecondsOnTargetFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2671,7 +2768,10 @@ it("Ec2XmlTimestampsWithHttpDateFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2713,7 +2813,10 @@ it("Ec2XmlTimestampsWithHttpDateOnTargetFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); diff --git a/private/aws-protocoltests-ec2/vite.config.js b/private/aws-protocoltests-ec2/vite.config.js new file mode 100644 index 000000000000..e7147d3ac9e1 --- /dev/null +++ b/private/aws-protocoltests-ec2/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-json-10/package.json b/private/aws-protocoltests-json-10/package.json index b13e1a9001c1..e2d868798277 100644 --- a/private/aws-protocoltests-json-10/package.json +++ b/private/aws-protocoltests-json-10/package.json @@ -64,7 +64,8 @@ "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "vitest": "2.1.8" }, "engines": { "node": ">=18.0.0" diff --git a/private/aws-protocoltests-json-10/test/functional/awsjson1_0.spec.ts b/private/aws-protocoltests-json-10/test/functional/awsjson1_0.spec.ts index 055b7cb94983..fb3628f1094a 100644 --- a/private/aws-protocoltests-json-10/test/functional/awsjson1_0.spec.ts +++ b/private/aws-protocoltests-json-10/test/functional/awsjson1_0.spec.ts @@ -3,6 +3,7 @@ import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { Encoder as __Encoder } from "@smithy/types"; import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; import { Readable } from "stream"; +import { expect, test as it } from "vitest"; import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; import { EndpointOperationCommand } from "../../src/commands/EndpointOperationCommand"; @@ -238,12 +239,10 @@ it("AwsJson10EmptyInputAndEmptyOutput:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.EmptyInputAndEmptyOutput"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -305,10 +304,9 @@ it("AwsJson10EndpointTrait:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("foo.example.com"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -344,10 +342,9 @@ it("AwsJson10EndpointTraitWithHostLabel:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("foo.bar.example.com"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"label\": \"bar\"}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -393,7 +390,10 @@ it("AwsJson10InvalidGreetingError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -754,7 +754,10 @@ it("AwsJson10ComplexError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -822,7 +825,7 @@ it("AwsJson10HostWithPath:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/custom/"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -857,12 +860,10 @@ it("AwsJson10SerializeStringUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -901,12 +902,10 @@ it("AwsJson10SerializeBooleanUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -945,12 +944,10 @@ it("AwsJson10SerializeNumberUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -989,12 +986,10 @@ it("AwsJson10SerializeBlobUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1033,12 +1028,10 @@ it("AwsJson10SerializeTimestampUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1077,12 +1070,10 @@ it("AwsJson10SerializeEnumUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1121,12 +1112,10 @@ it("AwsJson10SerializeIntEnumUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1165,12 +1154,10 @@ it("AwsJson10SerializeListUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1212,12 +1199,10 @@ it("AwsJson10SerializeMapUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1261,12 +1246,10 @@ it("AwsJson10SerializeStructureUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1319,7 +1302,10 @@ it("AwsJson10DeserializeStringUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1363,7 +1349,10 @@ it("AwsJson10DeserializeBooleanUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1407,7 +1396,10 @@ it("AwsJson10DeserializeNumberUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1451,7 +1443,10 @@ it("AwsJson10DeserializeBlobUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1495,7 +1490,10 @@ it("AwsJson10DeserializeTimestampUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1539,7 +1537,10 @@ it("AwsJson10DeserializeEnumUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1583,7 +1584,10 @@ it("AwsJson10DeserializeIntEnumUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1627,7 +1631,10 @@ it("AwsJson10DeserializeListUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1677,7 +1684,10 @@ it("AwsJson10DeserializeMapUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1725,7 +1735,10 @@ it("AwsJson10DeserializeStructureUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1774,7 +1787,10 @@ it("AwsJson10DeserializeIgnoreType:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1831,7 +1847,10 @@ it("AwsJson10DeserializeAllowNulls:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1864,12 +1883,10 @@ it("AwsJson10MustAlwaysSendEmptyJsonPayload:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.NoInputAndNoOutput"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -1999,12 +2016,10 @@ it("AwsJson10NoInputAndOutput:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.NoInputAndOutput"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2066,10 +2081,9 @@ it.skip("AwsJson10ClientPopulatesDefaultValuesInInput:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"defaults\": { @@ -2130,10 +2144,9 @@ it.skip("AwsJson10ClientSkipsTopLevelDefaultValuesInInput:Request", async () => expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ }`; @@ -2200,10 +2213,9 @@ it.skip("AwsJson10ClientUsesExplicitlyProvidedMemberValuesOverDefaults:Request", expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"defaults\": { @@ -2268,10 +2280,9 @@ it.skip("AwsJson10ClientUsesExplicitlyProvidedValuesInTopLevel:Request", async ( expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"topLevelDefault\": \"hi\", @@ -2307,10 +2318,9 @@ it.skip("AwsJson10ClientIgnoresNonTopLevelDefaultsOnMembersWithClientOptional:Re expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"clientOptionalDefaults\": {} @@ -2379,7 +2389,10 @@ it.skip("AwsJson10ClientPopulatesDefaultsValuesWhenMissingInResponse:Response", }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2477,7 +2490,10 @@ it.skip("AwsJson10ClientIgnoresDefaultValuesIfMemberValuesArePresentInResponse:R }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2537,10 +2553,9 @@ it.skip("AwsJson10ClientPopulatesNestedDefaultValuesWhenMissing:Request", async expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"topLevel\": { @@ -2695,7 +2710,10 @@ it.skip("AwsJson10ClientPopulatesNestedDefaultsWhenMissingInResponseBody:Respons }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2744,7 +2762,10 @@ it.skip("AwsJson10ClientErrorCorrectsWhenServerFailsToSerializeRequiredValues:Re }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2795,7 +2816,10 @@ it.skip("AwsJson10ClientErrorCorrectsWithDefaultValuesWhenServerFailsToSerialize }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2825,7 +2849,6 @@ it("SDKAppliedContentEncoding_awsJson1_0:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-encoding"]).toBeDefined(); expect(r.headers["content-encoding"]).toBe("gzip"); } }); @@ -2859,7 +2882,6 @@ it("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_0:Request", async () = expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-encoding"]).toBeDefined(); expect(r.headers["content-encoding"]).toBe("gzip"); } }); @@ -2890,12 +2912,10 @@ it("AwsJson10SupportsNaNFloatInputs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.SimpleScalarProperties"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"floatValue\": \"NaN\", @@ -2932,12 +2952,10 @@ it("AwsJson10SupportsInfinityFloatInputs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.SimpleScalarProperties"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"floatValue\": \"Infinity\", @@ -2974,12 +2992,10 @@ it("AwsJson10SupportsNegativeInfinityFloatInputs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.0"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonRpc10.SimpleScalarProperties"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"floatValue\": \"-Infinity\", @@ -3027,7 +3043,10 @@ it("AwsJson10SupportsNaNFloatInputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3069,7 +3088,10 @@ it("AwsJson10SupportsInfinityFloatInputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3111,7 +3133,10 @@ it("AwsJson10SupportsNegativeInfinityFloatInputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); diff --git a/private/aws-protocoltests-json-10/vite.config.js b/private/aws-protocoltests-json-10/vite.config.js new file mode 100644 index 000000000000..e7147d3ac9e1 --- /dev/null +++ b/private/aws-protocoltests-json-10/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-json-machinelearning/package.json b/private/aws-protocoltests-json-machinelearning/package.json index 97d66c2181b5..0e9d0bfd49a8 100644 --- a/private/aws-protocoltests-json-machinelearning/package.json +++ b/private/aws-protocoltests-json-machinelearning/package.json @@ -64,7 +64,8 @@ "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "vitest": "2.1.8" }, "engines": { "node": ">=18.0.0" diff --git a/private/aws-protocoltests-json-machinelearning/test/functional/awsjson1_1.spec.ts b/private/aws-protocoltests-json-machinelearning/test/functional/awsjson1_1.spec.ts index 38faa1f5dee2..deb379d9cc04 100644 --- a/private/aws-protocoltests-json-machinelearning/test/functional/awsjson1_1.spec.ts +++ b/private/aws-protocoltests-json-machinelearning/test/functional/awsjson1_1.spec.ts @@ -2,6 +2,7 @@ import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; import { Readable } from "stream"; +import { expect, test as it } from "vitest"; import { PredictCommand } from "../../src/commands/PredictCommand"; import { MachineLearningClient } from "../../src/MachineLearningClient"; @@ -232,13 +233,11 @@ it("MachinelearningPredictEndpoint:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("custom.example.com"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"MLModelId\": \"foo\", \"Record\": {}, \"PredictEndpoint\": \"https://custom.example.com/\"}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); diff --git a/private/aws-protocoltests-json-machinelearning/vite.config.js b/private/aws-protocoltests-json-machinelearning/vite.config.js new file mode 100644 index 000000000000..e7147d3ac9e1 --- /dev/null +++ b/private/aws-protocoltests-json-machinelearning/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-json/package.json b/private/aws-protocoltests-json/package.json index 41b989df486a..ce3b01548695 100644 --- a/private/aws-protocoltests-json/package.json +++ b/private/aws-protocoltests-json/package.json @@ -64,7 +64,8 @@ "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "vitest": "2.1.8" }, "engines": { "node": ">=18.0.0" diff --git a/private/aws-protocoltests-json/test/functional/awsjson1_1.spec.ts b/private/aws-protocoltests-json/test/functional/awsjson1_1.spec.ts index 99f430f63304..83e7e8b8aed7 100644 --- a/private/aws-protocoltests-json/test/functional/awsjson1_1.spec.ts +++ b/private/aws-protocoltests-json/test/functional/awsjson1_1.spec.ts @@ -3,6 +3,7 @@ import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { Encoder as __Encoder } from "@smithy/types"; import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; import { Readable } from "stream"; +import { expect, test as it } from "vitest"; import { DatetimeOffsetsCommand } from "../../src/commands/DatetimeOffsetsCommand"; import { EmptyOperationCommand } from "../../src/commands/EmptyOperationCommand"; @@ -254,7 +255,10 @@ it("AwsJson11DateTimeWithNegativeOffset:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -295,7 +299,10 @@ it("AwsJson11DateTimeWithPositiveOffset:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -323,9 +330,7 @@ it("sends_requests_to_slash:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.EmptyOperation"); } }); @@ -353,9 +358,7 @@ it("includes_x_amz_target_and_content_type:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.EmptyOperation"); } }); @@ -388,12 +391,10 @@ it("json_1_1_client_sends_empty_payload_for_no_input_shape:Request", async () => expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.EmptyOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -525,15 +526,12 @@ it("AwsJson11EndpointTrait:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.EndpointOperation"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("foo.example.com"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -569,15 +567,12 @@ it("AwsJson11EndpointTraitWithHostLabel:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.EndpointWithHostLabelOperation"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("foo.bar.example.com"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"label\": \"bar\"}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -621,7 +616,10 @@ it("AwsJson11DateTimeWithFractionalSeconds:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -664,7 +662,10 @@ it("AwsJson11InvalidGreetingError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -716,7 +717,10 @@ it("AwsJson11ComplexError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -1090,12 +1094,10 @@ it("AwsJson11HostWithPath:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/custom/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.HostWithPathOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -1136,12 +1138,10 @@ it("AwsJson11Enums:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonEnums"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"fooEnum1\": \"Foo\", @@ -1222,7 +1222,10 @@ it("AwsJson11Enums:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1260,12 +1263,10 @@ it("AwsJson11IntEnums:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonIntEnums"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"intEnum1\": 1, @@ -1347,7 +1348,10 @@ it("AwsJson11IntEnums:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1379,12 +1383,10 @@ it("AwsJson11SerializeStringUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1423,12 +1425,10 @@ it("AwsJson11SerializeBooleanUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1467,12 +1467,10 @@ it("AwsJson11SerializeNumberUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1511,12 +1509,10 @@ it("AwsJson11SerializeBlobUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1555,12 +1551,10 @@ it("AwsJson11SerializeTimestampUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1599,12 +1593,10 @@ it("AwsJson11SerializeEnumUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1643,12 +1635,10 @@ it("AwsJson11SerializeListUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1690,12 +1680,10 @@ it("AwsJson11SerializeMapUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1739,12 +1727,10 @@ it("AwsJson11SerializeStructureUnionValue:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.JsonUnions"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -1797,7 +1783,10 @@ it("AwsJson11DeserializeStringUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1841,7 +1830,10 @@ it("AwsJson11DeserializeBooleanUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1885,7 +1877,10 @@ it("AwsJson11DeserializeNumberUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1929,7 +1924,10 @@ it("AwsJson11DeserializeBlobUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1973,7 +1971,10 @@ it("AwsJson11DeserializeTimestampUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2017,7 +2018,10 @@ it("AwsJson11DeserializeEnumUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2061,7 +2065,10 @@ it("AwsJson11DeserializeListUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2111,7 +2118,10 @@ it("AwsJson11DeserializeMapUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2159,7 +2169,10 @@ it("AwsJson11DeserializeStructureUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2208,7 +2221,10 @@ it("AwsJson11DeserializeIgnoreType:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2237,14 +2253,15 @@ it("serializes_string_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"String\":\"abc xyz\"}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2277,14 +2294,15 @@ it("serializes_string_shapes_with_jsonvalue_trait:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"JsonValue\":\"{\\"string\\":\\"value\\",\\"number\\":1234.5,\\"boolTrue\\":true,\\"boolFalse\\":false,\\"array\\":[1,2,3,4],\\"object\\":{\\"key\\":\\"value\\"},\\"null\\":null}\"}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2316,14 +2334,15 @@ it("serializes_integer_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"Integer\":1234}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2355,14 +2374,15 @@ it("serializes_long_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"Long\":999999999999}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2394,14 +2414,15 @@ it("serializes_float_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"Float\":1234.5}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2433,14 +2454,15 @@ it("serializes_double_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"Double\":1234.5}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2472,14 +2494,15 @@ it("serializes_blob_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"Blob\":\"YmluYXJ5LXZhbHVl\"}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2511,14 +2534,15 @@ it("serializes_boolean_shapes_true:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"Boolean\":true}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2550,14 +2574,15 @@ it("serializes_boolean_shapes_false:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"Boolean\":false}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2589,14 +2614,15 @@ it("serializes_timestamp_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"Timestamp\":946845296}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2628,14 +2654,15 @@ it("serializes_timestamp_shapes_with_iso8601_timestampformat:Request", async () const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"Iso8601Timestamp\":\"2000-01-02T20:34:56Z\"}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2667,14 +2694,15 @@ it("serializes_timestamp_shapes_with_httpdate_timestampformat:Request", async () const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"HttpdateTimestamp\":\"Sun, 02 Jan 2000 20:34:56 GMT\"}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2706,14 +2734,15 @@ it("serializes_timestamp_shapes_with_unixtimestamp_timestampformat:Request", asy const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"UnixTimestamp\":946845296}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2745,14 +2774,15 @@ it("serializes_list_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"ListOfStrings\":[\"abc\",\"mno\",\"xyz\"]}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2784,14 +2814,15 @@ it("serializes_empty_list_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"ListOfStrings\":[]}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2833,14 +2864,15 @@ it("serializes_list_of_map_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"ListOfMapsOfStrings\":[{\"foo\":\"bar\"},{\"abc\":\"xyz\"},{\"red\":\"blue\"}]}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2882,14 +2914,15 @@ it("serializes_list_of_structure_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"ListOfStructs\":[{\"Value\":\"abc\"},{\"Value\":\"mno\"},{\"Value\":\"xyz\"}]}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2933,14 +2966,15 @@ it("serializes_list_of_recursive_structure_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"RecursiveList\":[{\"RecursiveList\":[{\"RecursiveList\":[{\"Integer\":123}]}]}]}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2975,14 +3009,15 @@ it("serializes_map_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"MapOfStrings\":{\"abc\":\"xyz\",\"mno\":\"hjk\"}}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -3014,14 +3049,15 @@ it("serializes_empty_map_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"MapOfStrings\":{}}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -3056,14 +3092,15 @@ it("serializes_map_of_list_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"MapOfListsOfStrings\":{\"abc\":[\"abc\",\"xyz\"],\"mno\":[\"xyz\",\"abc\"]}}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -3102,14 +3139,15 @@ it("serializes_map_of_structure_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"MapOfStructs\":{\"key1\":{\"Value\":\"value-1\"},\"key2\":{\"Value\":\"value-2\"}}}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -3153,14 +3191,15 @@ it("serializes_map_of_recursive_structure_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"RecursiveMap\":{\"key1\":{\"RecursiveMap\":{\"key2\":{\"RecursiveMap\":{\"key3\":{\"Boolean\":false}}}}}}}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -3194,14 +3233,15 @@ it("serializes_structure_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"SimpleStruct\":{\"Value\":\"abc\"}}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -3235,14 +3275,15 @@ it("serializes_structure_members_with_locationname_traits:Request", async () => const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"StructWithJsonName\":{\"Value\":\"some-value\"}}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -3274,14 +3315,15 @@ it("serializes_empty_structure_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"SimpleStruct\":{}}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -3313,14 +3355,15 @@ it("serializes_structure_which_have_no_members:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"EmptyStruct\":{}}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -3370,14 +3413,15 @@ it("serializes_recursive_structure_shapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.KitchenSinkOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"String\":\"top-value\",\"Boolean\":false,\"RecursiveStruct\":{\"String\":\"nested-value\",\"Boolean\":true,\"RecursiveList\":[{\"String\":\"string-only\"},{\"RecursiveStruct\":{\"MapOfStrings\":{\"color\":\"red\",\"size\":\"large\"}}}]}}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -3447,7 +3491,10 @@ it("parses_string_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3485,7 +3532,10 @@ it("parses_integer_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3523,7 +3573,10 @@ it("parses_long_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3561,7 +3614,10 @@ it("parses_float_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3599,7 +3655,10 @@ it("parses_double_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3637,7 +3696,10 @@ it("parses_boolean_shapes_true:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3675,7 +3737,10 @@ it("parses_boolean_false:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3713,7 +3778,10 @@ it("parses_blob_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3751,7 +3819,10 @@ it("parses_timestamp_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3789,7 +3860,10 @@ it("parses_iso8601_timestamps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3827,7 +3901,10 @@ it("parses_httpdate_timestamps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3865,7 +3942,10 @@ it("parses_list_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3910,7 +3990,10 @@ it("parses_list_of_map_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3951,7 +4034,10 @@ it("parses_list_of_list_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3996,7 +4082,10 @@ it("parses_list_of_structure_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4046,7 +4135,10 @@ it("parses_list_of_recursive_structure_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4087,7 +4179,10 @@ it("parses_map_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4128,7 +4223,10 @@ it("parses_map_of_list_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4175,7 +4273,10 @@ it("parses_map_of_map_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4220,7 +4321,10 @@ it("parses_map_of_structure_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4270,7 +4374,10 @@ it("parses_map_of_recursive_structure_shapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4330,12 +4437,10 @@ it("AwsJson11StructuresDontSerializeNullValues:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.NullOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -4397,12 +4502,10 @@ it("can_call_operation_with_no_input_or_output:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.OperationWithOptionalInputOutput"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -4435,12 +4538,10 @@ it("can_call_operation_with_optional_input:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.OperationWithOptionalInputOutput"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"Value\":\"Hi\"}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -4474,14 +4575,15 @@ it("PutAndGetInlineDocumentsInput:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.PutAndGetInlineDocuments"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"inlineDocument\": {\"foo\": \"bar\"} @@ -4528,7 +4630,10 @@ it("PutAndGetInlineDocumentsInput:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4558,7 +4663,6 @@ it("SDKAppliedContentEncoding_awsJson1_1:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-encoding"]).toBeDefined(); expect(r.headers["content-encoding"]).toBe("gzip"); } }); @@ -4592,7 +4696,6 @@ it("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_1:Request", async () = expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-encoding"]).toBeDefined(); expect(r.headers["content-encoding"]).toBe("gzip"); } }); @@ -4623,12 +4726,10 @@ it("AwsJson11SupportsNaNFloatInputs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.SimpleScalarProperties"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"floatValue\": \"NaN\", @@ -4665,12 +4766,10 @@ it("AwsJson11SupportsInfinityFloatInputs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.SimpleScalarProperties"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"floatValue\": \"Infinity\", @@ -4707,12 +4806,10 @@ it("AwsJson11SupportsNegativeInfinityFloatInputs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.SimpleScalarProperties"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"floatValue\": \"-Infinity\", @@ -4760,7 +4857,10 @@ it("AwsJson11SupportsNaNFloatInputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4802,7 +4902,10 @@ it("AwsJson11SupportsInfinityFloatInputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4844,7 +4947,10 @@ it("AwsJson11SupportsNegativeInfinityFloatInputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4876,12 +4982,10 @@ it("AwsJson11SparseMapsSerializeNullValues:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.SparseNullsOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"sparseStringMap\": { @@ -4918,12 +5022,10 @@ it("AwsJson11SparseListsSerializeNull:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-amz-json-1.1"); - expect(r.headers["x-amz-target"]).toBeDefined(); expect(r.headers["x-amz-target"]).toBe("JsonProtocol.SparseNullsOperation"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"sparseStringList\": [ @@ -4974,7 +5076,10 @@ it("AwsJson11SparseMapsDeserializeNullValues:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5016,7 +5121,10 @@ it("AwsJson11SparseListsDeserializeNull:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); diff --git a/private/aws-protocoltests-json/vite.config.js b/private/aws-protocoltests-json/vite.config.js new file mode 100644 index 000000000000..e7147d3ac9e1 --- /dev/null +++ b/private/aws-protocoltests-json/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-query/package.json b/private/aws-protocoltests-query/package.json index e18c938b8f98..562c1db98078 100644 --- a/private/aws-protocoltests-query/package.json +++ b/private/aws-protocoltests-query/package.json @@ -64,7 +64,8 @@ "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "vitest": "2.1.8" }, "engines": { "node": ">=18.0.0" diff --git a/private/aws-protocoltests-query/test/functional/awsquery.spec.ts b/private/aws-protocoltests-query/test/functional/awsquery.spec.ts index b7c25a4c7321..68fd9e03672b 100644 --- a/private/aws-protocoltests-query/test/functional/awsquery.spec.ts +++ b/private/aws-protocoltests-query/test/functional/awsquery.spec.ts @@ -3,6 +3,7 @@ import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { Encoder as __Encoder } from "@smithy/types"; import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; import { Readable } from "stream"; +import { expect, test as it } from "vitest"; import { DatetimeOffsetsCommand } from "../../src/commands/DatetimeOffsetsCommand"; import { EmptyInputAndEmptyOutputCommand } from "../../src/commands/EmptyInputAndEmptyOutputCommand"; @@ -272,7 +273,10 @@ it("AwsQueryDateTimeWithNegativeOffset:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -315,7 +319,10 @@ it("AwsQueryDateTimeWithPositiveOffset:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -343,10 +350,9 @@ it("QueryEmptyInputAndEmptyOutput:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=EmptyInputAndEmptyOutput&Version=2020-01-08`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -401,13 +407,11 @@ it("AwsQueryEndpointTrait:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("foo.example.com"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=EndpointOperation&Version=2020-01-08`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -443,13 +447,11 @@ it("AwsQueryEndpointTraitWithHostLabel:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("foo.bar.example.com"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=EndpointWithHostLabelOperation&Version=2020-01-08&label=bar`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -504,7 +506,10 @@ it("QueryQueryFlattenedXmlMap:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -556,7 +561,10 @@ it("QueryQueryFlattenedXmlMapWithXmlName:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -608,7 +616,10 @@ it("QueryQueryFlattenedXmlMapWithXmlNamespace:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -651,7 +662,10 @@ it("AwsQueryDateTimeWithFractionalSeconds:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -694,7 +708,10 @@ it("QueryGreetingWithErrors:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -742,7 +759,10 @@ it("QueryInvalidGreetingError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -793,7 +813,10 @@ it("QueryCustomizedError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -847,7 +870,10 @@ it("QueryComplexError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -879,7 +905,7 @@ it("QueryHostWithPath:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/custom/"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=HostWithPathOperation&Version=2020-01-08`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -925,7 +951,10 @@ it("QueryIgnoresWrappingXmlName:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -960,12 +989,14 @@ it("NestedStructures:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=NestedStructures&Version=2020-01-08&Nested.StringArg=foo&Nested.OtherArg=true&Nested.RecursiveArg.StringArg=baz`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -996,10 +1027,9 @@ it("QueryNoInputAndNoOutput:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=NoInputAndNoOutput&Version=2020-01-08`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1052,10 +1082,9 @@ it("QueryNoInputAndOutput:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=NoInputAndOutput&Version=2020-01-08`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1110,7 +1139,6 @@ it("SDKAppliedContentEncoding_awsQuery:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-encoding"]).toBeDefined(); expect(r.headers["content-encoding"]).toBe("gzip"); } }); @@ -1144,7 +1172,6 @@ it("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsQuery:Request", async () => expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-encoding"]).toBeDefined(); expect(r.headers["content-encoding"]).toBe("gzip"); } }); @@ -1173,12 +1200,14 @@ it("QueryProtocolIdempotencyTokenAutoFill:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryIdempotencyTokenAutoFill&Version=2020-01-08&token=00000000-0000-4000-8000-000000000000`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1210,12 +1239,14 @@ it("QueryProtocolIdempotencyTokenAutoFillIsSet:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryIdempotencyTokenAutoFill&Version=2020-01-08&token=00000000-0000-4000-8000-000000000123`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1256,10 +1287,9 @@ it("QueryLists:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryLists&Version=2020-01-08&ListArg.member.1=foo&ListArg.member.2=bar&ListArg.member.3=baz&ComplexListArg.member.1.hi=hello&ComplexListArg.member.2.hi=hola`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1292,10 +1322,9 @@ it("EmptyQueryLists:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryLists&Version=2020-01-08&ListArg=`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1328,10 +1357,9 @@ it("FlattenedQueryLists:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryLists&Version=2020-01-08&FlattenedListArg.1=A&FlattenedListArg.2=B`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1364,10 +1392,9 @@ it("QueryListArgWithXmlNameMember:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryLists&Version=2020-01-08&ListArgWithXmlNameMember.item.1=A&ListArgWithXmlNameMember.item.2=B`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1400,10 +1427,9 @@ it("QueryFlattenedListArgWithXmlName:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryLists&Version=2020-01-08&Hi.1=A&Hi.2=B`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1438,10 +1464,9 @@ it("QueryNestedStructWithList:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryLists&Version=2020-01-08&NestedWithList.ListArg.member.1=A&NestedWithList.ListArg.member.2=B`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1477,10 +1502,9 @@ it("QuerySimpleQueryMaps:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryMaps&Version=2020-01-08&MapArg.entry.1.key=bar&MapArg.entry.1.value=Bar&MapArg.entry.2.key=foo&MapArg.entry.2.value=Foo`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1515,10 +1539,9 @@ it("QuerySimpleQueryMapsWithXmlName:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryMaps&Version=2020-01-08&Foo.entry.1.key=foo&Foo.entry.1.value=Foo`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1558,10 +1581,9 @@ it("QueryComplexQueryMaps:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryMaps&Version=2020-01-08&ComplexMapArg.entry.1.key=bar&ComplexMapArg.entry.1.value.hi=Bar&ComplexMapArg.entry.2.key=foo&ComplexMapArg.entry.2.value.hi=Foo`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1594,10 +1616,9 @@ it("QueryEmptyQueryMaps:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryMaps&Version=2020-01-08`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1633,10 +1654,9 @@ it("QueryQueryMapWithMemberXmlName:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryMaps&Version=2020-01-08&MapWithXmlMemberName.entry.1.K=bar&MapWithXmlMemberName.entry.1.V=Bar&MapWithXmlMemberName.entry.2.K=foo&MapWithXmlMemberName.entry.2.V=Foo`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1672,10 +1692,9 @@ it("QueryFlattenedQueryMaps:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryMaps&Version=2020-01-08&FlattenedMap.1.key=bar&FlattenedMap.1.value=Bar&FlattenedMap.2.key=foo&FlattenedMap.2.value=Foo`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1711,10 +1730,9 @@ it("QueryFlattenedQueryMapsWithXmlName:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryMaps&Version=2020-01-08&Hi.1.K=bar&Hi.1.V=Bar&Hi.2.K=foo&Hi.2.V=Foo`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1750,10 +1768,9 @@ it("QueryQueryMapOfLists:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryMaps&Version=2020-01-08&MapOfLists.entry.1.key=bar&MapOfLists.entry.1.value.member.1=C&MapOfLists.entry.1.value.member.2=D&MapOfLists.entry.2.key=foo&MapOfLists.entry.2.value.member.1=A&MapOfLists.entry.2.value.member.2=B`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1791,10 +1808,9 @@ it("QueryNestedStructWithMap:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryMaps&Version=2020-01-08&NestedStructWithMap.MapArg.entry.1.key=bar&NestedStructWithMap.MapArg.entry.1.value=Bar&NestedStructWithMap.MapArg.entry.2.key=foo&NestedStructWithMap.MapArg.entry.2.value=Foo`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1828,12 +1844,14 @@ it("QueryTimestampsInput:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=QueryTimestamps&Version=2020-01-08&normalFormat=2015-01-25T08%3A00%3A00Z&epochMember=1422172800&epochTarget=1422172800`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1901,7 +1919,10 @@ it("QueryRecursiveShapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1931,12 +1952,14 @@ it("QuerySimpleInputParamsStrings:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Foo=val1&Bar=val2`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -1969,12 +1992,14 @@ it("QuerySimpleInputParamsStringAndBooleanTrue:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Foo=val1&Baz=true`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -2006,12 +2031,14 @@ it("QuerySimpleInputParamsStringsAndBooleanFalse:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Baz=false`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -2043,12 +2070,14 @@ it("QuerySimpleInputParamsInteger:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Bam=10`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -2080,12 +2109,14 @@ it("QuerySimpleInputParamsFloat:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Boo=10.8`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -2117,12 +2148,14 @@ it("QuerySimpleInputParamsBlob:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&Qux=dmFsdWU%3D`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -2154,12 +2187,14 @@ it("QueryEnums:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FooEnum=Foo`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -2191,12 +2226,14 @@ it("QueryIntEnums:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&IntegerEnum=1`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -2229,12 +2266,14 @@ it("AwsQuerySupportsNaNFloatInputs:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FloatValue=NaN&Boo=NaN`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -2267,12 +2306,14 @@ it("AwsQuerySupportsInfinityFloatInputs:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FloatValue=Infinity&Boo=Infinity`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -2305,12 +2346,14 @@ it("AwsQuerySupportsNegativeInfinityFloatInputs:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/x-www-form-urlencoded"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Action=SimpleInputParams&Version=2020-01-08&FloatValue=-Infinity&Boo=-Infinity`; const unequalParts: any = compareEquivalentFormUrlencodedBodies(bodyString, r.body.toString()); @@ -2374,7 +2417,10 @@ it("QuerySimpleScalarProperties:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2419,7 +2465,10 @@ it("AwsQuerySupportsNaNFloatOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2464,7 +2513,10 @@ it("AwsQuerySupportsInfinityFloatOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2509,7 +2561,10 @@ it("AwsQuerySupportsNegativeInfinityFloatOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2552,7 +2607,10 @@ it("QueryXmlBlobs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2595,7 +2653,10 @@ it("QueryXmlEmptyBlobs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2638,7 +2699,10 @@ it("QueryXmlEmptySelfClosedBlobs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2683,7 +2747,10 @@ it("QueryXmlEmptyLists:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2727,7 +2794,10 @@ it("QueryXmlEmptyMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2770,7 +2840,10 @@ it("QueryXmlEmptySelfClosedMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2841,7 +2914,10 @@ it("QueryXmlEnums:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2912,7 +2988,10 @@ it("QueryXmlIntEnums:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3039,7 +3118,10 @@ it("QueryXmlLists:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3102,7 +3184,10 @@ it("QueryXmlMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3165,7 +3250,10 @@ it("QueryQueryXmlMapsXmlName:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3217,7 +3305,10 @@ it("QueryXmlNamespaces:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3260,7 +3351,10 @@ it("QueryXmlTimestamps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3303,7 +3397,10 @@ it("QueryXmlTimestampsWithDateTimeFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3346,7 +3443,10 @@ it("QueryXmlTimestampsWithDateTimeOnTargetFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3389,7 +3489,10 @@ it("QueryXmlTimestampsWithEpochSecondsFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3432,7 +3535,10 @@ it("QueryXmlTimestampsWithEpochSecondsOnTargetFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3475,7 +3581,10 @@ it("QueryXmlTimestampsWithHttpDateFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3518,7 +3627,10 @@ it("QueryXmlTimestampsWithHttpDateOnTargetFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); diff --git a/private/aws-protocoltests-query/vite.config.js b/private/aws-protocoltests-query/vite.config.js new file mode 100644 index 000000000000..e7147d3ac9e1 --- /dev/null +++ b/private/aws-protocoltests-query/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-restjson-apigateway/package.json b/private/aws-protocoltests-restjson-apigateway/package.json index 01249037605f..9c26f334dc27 100644 --- a/private/aws-protocoltests-restjson-apigateway/package.json +++ b/private/aws-protocoltests-restjson-apigateway/package.json @@ -64,7 +64,8 @@ "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "vitest": "2.1.8" }, "engines": { "node": ">=18.0.0" diff --git a/private/aws-protocoltests-restjson-apigateway/test/functional/restjson1.spec.ts b/private/aws-protocoltests-restjson-apigateway/test/functional/restjson1.spec.ts index cb593a773ca7..5faa57ddf46a 100644 --- a/private/aws-protocoltests-restjson-apigateway/test/functional/restjson1.spec.ts +++ b/private/aws-protocoltests-restjson-apigateway/test/functional/restjson1.spec.ts @@ -2,6 +2,7 @@ import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; import { Readable } from "stream"; +import { expect, test as it } from "vitest"; import { APIGatewayClient } from "../../src/APIGatewayClient"; import { GetRestApisCommand } from "../../src/commands/GetRestApisCommand"; @@ -224,7 +225,6 @@ it("ApiGatewayAccept:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/restapis"); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/json"); expect(!r.body || r.body === `{}`).toBeTruthy(); diff --git a/private/aws-protocoltests-restjson-apigateway/vite.config.js b/private/aws-protocoltests-restjson-apigateway/vite.config.js new file mode 100644 index 000000000000..e7147d3ac9e1 --- /dev/null +++ b/private/aws-protocoltests-restjson-apigateway/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-restjson-glacier/package.json b/private/aws-protocoltests-restjson-glacier/package.json index 83ba4a6eb717..421158d168d2 100644 --- a/private/aws-protocoltests-restjson-glacier/package.json +++ b/private/aws-protocoltests-restjson-glacier/package.json @@ -66,7 +66,8 @@ "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "vitest": "2.1.8" }, "engines": { "node": ">=18.0.0" diff --git a/private/aws-protocoltests-restjson-glacier/test/functional/restjson1.spec.ts b/private/aws-protocoltests-restjson-glacier/test/functional/restjson1.spec.ts index 638364712ffb..a2136d9d3019 100644 --- a/private/aws-protocoltests-restjson-glacier/test/functional/restjson1.spec.ts +++ b/private/aws-protocoltests-restjson-glacier/test/functional/restjson1.spec.ts @@ -3,6 +3,7 @@ import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { Encoder as __Encoder } from "@smithy/types"; import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; import { Readable } from "stream"; +import { expect, test as it } from "vitest"; import { UploadArchiveCommand } from "../../src/commands/UploadArchiveCommand"; import { UploadMultipartPartCommand } from "../../src/commands/UploadMultipartPartCommand"; @@ -229,7 +230,6 @@ it("GlacierVersionHeader:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/foo/vaults/bar/archives"); - expect(r.headers["x-amz-glacier-version"]).toBeDefined(); expect(r.headers["x-amz-glacier-version"]).toBe("2012-06-01"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -263,16 +263,13 @@ it("GlacierChecksums:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/foo/vaults/bar/archives"); - expect(r.headers["x-amz-content-sha256"]).toBeDefined(); expect(r.headers["x-amz-content-sha256"]).toBe("b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"); - expect(r.headers["x-amz-glacier-version"]).toBeDefined(); expect(r.headers["x-amz-glacier-version"]).toBe("2012-06-01"); - expect(r.headers["x-amz-sha256-tree-hash"]).toBeDefined(); expect(r.headers["x-amz-sha256-tree-hash"]).toBe( "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9" ); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `hello world`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -308,7 +305,6 @@ it.skip("GlacierAccountId:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/-/vaults/bar/archives"); - expect(r.headers["x-amz-glacier-version"]).toBeDefined(); expect(r.headers["x-amz-glacier-version"]).toBe("2012-06-01"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -343,16 +339,13 @@ it("GlacierMultipartChecksums:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/foo/vaults/bar/multipart-uploads/baz"); - expect(r.headers["x-amz-content-sha256"]).toBeDefined(); expect(r.headers["x-amz-content-sha256"]).toBe("b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"); - expect(r.headers["x-amz-glacier-version"]).toBeDefined(); expect(r.headers["x-amz-glacier-version"]).toBe("2012-06-01"); - expect(r.headers["x-amz-sha256-tree-hash"]).toBeDefined(); expect(r.headers["x-amz-sha256-tree-hash"]).toBe( "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9" ); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `hello world`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); diff --git a/private/aws-protocoltests-restjson-glacier/vite.config.js b/private/aws-protocoltests-restjson-glacier/vite.config.js new file mode 100644 index 000000000000..e7147d3ac9e1 --- /dev/null +++ b/private/aws-protocoltests-restjson-glacier/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-restjson/package.json b/private/aws-protocoltests-restjson/package.json index 49bce490f2ad..44c80a4a1e9c 100644 --- a/private/aws-protocoltests-restjson/package.json +++ b/private/aws-protocoltests-restjson/package.json @@ -70,7 +70,8 @@ "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "vitest": "2.1.8" }, "engines": { "node": ">=18.0.0" diff --git a/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts b/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts index 5dcade9cce99..1a8cad7801e7 100644 --- a/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts +++ b/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts @@ -4,6 +4,7 @@ import { buildQueryString } from "@smithy/querystring-builder"; import { Encoder as __Encoder } from "@smithy/types"; import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; import { Readable } from "stream"; +import { expect, test as it } from "vitest"; import { AllQueryStringTypesCommand } from "../../src/commands/AllQueryStringTypesCommand"; import { ConstantAndVariableQueryStringCommand } from "../../src/commands/ConstantAndVariableQueryStringCommand"; @@ -627,7 +628,10 @@ it("RestJsonConstantAndVariableQueryStringMissingOneValue:Request", async () => expect(r.method).toBe("GET"); expect(r.path).toBe("/ConstantAndVariableQueryString"); - expect(r.query["maybeSet"]).toBeUndefined(); + expect( + r.query["maybeSet"], + `Query key "maybeSet" should have been undefined in ${JSON.stringify(r.query)}` + ).toBeUndefined(); const queryString = buildQueryString(r.query); expect(queryString).toContain("foo=bar"); @@ -739,7 +743,10 @@ it("RestJsonDateTimeWithNegativeOffset:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -778,7 +785,10 @@ it("RestJsonDateTimeWithPositiveOffset:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -811,10 +821,9 @@ it("DocumentTypeInputWithObject:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/DocumentType"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"stringValue\": \"string\", @@ -853,10 +862,9 @@ it("DocumentInputWithString:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/DocumentType"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"stringValue\": \"string\", @@ -893,10 +901,9 @@ it("DocumentInputWithNumber:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/DocumentType"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"stringValue\": \"string\", @@ -933,10 +940,9 @@ it("DocumentInputWithBoolean:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/DocumentType"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"stringValue\": \"string\", @@ -982,10 +988,9 @@ it("DocumentInputWithList:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/DocumentType"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"stringValue\": \"string\", @@ -1052,7 +1057,10 @@ it("DocumentOutput:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1094,7 +1102,10 @@ it("DocumentOutputString:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1136,7 +1147,10 @@ it("DocumentOutputNumber:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1178,7 +1192,10 @@ it("DocumentOutputBoolean:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1223,7 +1240,10 @@ it("DocumentOutputArray:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1260,10 +1280,9 @@ it("DocumentTypeAsMapValueInput:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/DocumentTypeAsMapValue"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"docValuedMap\": { @@ -1323,7 +1342,10 @@ it("DocumentTypeAsMapValueOutput:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1355,10 +1377,9 @@ it("DocumentTypeAsPayloadInput:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/DocumentTypeAsPayload"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"foo\": \"bar\" @@ -1393,10 +1414,9 @@ it("DocumentTypeAsPayloadInputString:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/DocumentTypeAsPayload"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `\"hello\"`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -1441,7 +1461,10 @@ it("DocumentTypeAsPayloadOutput:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1479,7 +1502,10 @@ it("DocumentTypeAsPayloadOutputString:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1592,7 +1618,6 @@ it("RestJsonEndpointTrait:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/EndpointOperation"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("foo.example.com"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -1627,10 +1652,9 @@ it("RestJsonEndpointTraitWithHostLabel:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/EndpointWithHostLabelOperation"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("foo.bar.example.com"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"label\": \"bar\"}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -1672,7 +1696,10 @@ it("RestJsonDateTimeWithFractionalSeconds:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1714,7 +1741,10 @@ it("RestJsonGreetingWithErrors:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1754,7 +1784,10 @@ it("RestJsonGreetingWithErrorsNoPayload:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2114,7 +2147,10 @@ it("RestJsonComplexErrorWithNoMessage:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -2192,7 +2228,10 @@ it("RestJsonInvalidGreetingError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -2253,12 +2292,10 @@ it("RestJsonHttpChecksumRequired:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/HttpChecksumRequired"); - expect(r.headers["content-md5"]).toBeDefined(); expect(r.headers["content-md5"]).toBe("iB0/3YSo7maijL0IGOgA9g=="); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"foo\":\"base64 encoded md5 checksum\" @@ -2291,10 +2328,9 @@ it("RestJsonEnumPayloadRequest:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/EnumPayload"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("text/plain"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `enumvalue`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -2332,7 +2368,10 @@ it("RestJsonEnumPayloadResponse:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2362,14 +2401,15 @@ it("RestJsonHttpPayloadTraitsWithBlob:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/HttpPayloadTraits"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/octet-stream"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `blobby blob blob`; const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); @@ -2402,7 +2442,6 @@ it("RestJsonHttpPayloadTraitsWithNoBlobBody:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/HttpPayloadTraits"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -2443,7 +2482,10 @@ it("RestJsonHttpPayloadTraitsWithBlob:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2481,7 +2523,10 @@ it("RestJsonHttpPayloadTraitsWithNoBlobBody:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2511,14 +2556,15 @@ it("RestJsonHttpPayloadTraitsWithMediaTypeWithBlob:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/HttpPayloadTraitsWithMediaType"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("text/plain"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `blobby blob blob`; const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); @@ -2561,7 +2607,10 @@ it("RestJsonHttpPayloadTraitsWithMediaTypeWithBlob:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2593,12 +2642,14 @@ it("RestJsonHttpPayloadWithStructure:Request", async () => { const r = err.request; expect(r.method).toBe("PUT"); expect(r.path).toBe("/HttpPayloadWithStructure"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"greeting\": \"hello\", @@ -2648,7 +2699,10 @@ it("RestJsonHttpPayloadWithStructure:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2679,12 +2733,14 @@ it("RestJsonHttpPayloadWithUnion:Request", async () => { const r = err.request; expect(r.method).toBe("PUT"); expect(r.path).toBe("/HttpPayloadWithUnion"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"greeting\": \"hello\" @@ -2758,7 +2814,10 @@ it("RestJsonHttpPayloadWithUnion:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2821,11 +2880,8 @@ it("RestJsonHttpPrefixHeadersArePresent:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/HttpPrefixHeaders"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.headers["x-foo-abc"]).toBeDefined(); expect(r.headers["x-foo-abc"]).toBe("Abc value"); - expect(r.headers["x-foo-def"]).toBeDefined(); expect(r.headers["x-foo-def"]).toBe("Def value"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -2858,7 +2914,6 @@ it("RestJsonHttpPrefixHeadersAreNotPresent:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/HttpPrefixHeaders"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -2892,7 +2947,6 @@ it("RestJsonHttpPrefixEmptyHeaders:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/HttpPrefixHeaders"); - expect(r.headers["x-foo-abc"]).toBeDefined(); expect(r.headers["x-foo-abc"]).toBe(""); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -2933,7 +2987,10 @@ it("RestJsonHttpPrefixHeadersArePresent:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2970,7 +3027,10 @@ it("HttpPrefixHeadersResponse:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3272,7 +3332,10 @@ it("RestJsonHttpResponseCode:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3305,7 +3368,10 @@ it("RestJsonHttpResponseCodeWithNoPayload:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3331,12 +3397,14 @@ it("RestJsonStringPayloadRequest:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/StringPayload"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("text/plain"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `rawstring`; const unequalParts: any = compareEquivalentTextBodies(bodyString, r.body); @@ -3374,7 +3442,10 @@ it("RestJsonStringPayloadResponse:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3462,11 +3533,8 @@ it("RestJsonInputAndOutputWithStringHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-string"]).toBeDefined(); expect(r.headers["x-string"]).toBe("Hello"); - expect(r.headers["x-stringlist"]).toBeDefined(); expect(r.headers["x-stringlist"]).toBe("a, b, c"); - expect(r.headers["x-stringset"]).toBeDefined(); expect(r.headers["x-stringset"]).toBe("a, b, c"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3498,7 +3566,6 @@ it("RestJsonInputAndOutputWithQuotedStringHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-stringlist"]).toBeDefined(); expect(r.headers["x-stringlist"]).toBe('"b,c", "\\"def\\"", a'); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3536,19 +3603,12 @@ it("RestJsonInputAndOutputWithNumericHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-byte"]).toBeDefined(); expect(r.headers["x-byte"]).toBe("1"); - expect(r.headers["x-double"]).toBeDefined(); expect(r.headers["x-double"]).toBe("1.1"); - expect(r.headers["x-float"]).toBeDefined(); expect(r.headers["x-float"]).toBe("1.1"); - expect(r.headers["x-integer"]).toBeDefined(); expect(r.headers["x-integer"]).toBe("123"); - expect(r.headers["x-integerlist"]).toBeDefined(); expect(r.headers["x-integerlist"]).toBe("1, 2, 3"); - expect(r.headers["x-long"]).toBeDefined(); expect(r.headers["x-long"]).toBe("123"); - expect(r.headers["x-short"]).toBeDefined(); expect(r.headers["x-short"]).toBe("123"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3582,11 +3642,8 @@ it("RestJsonInputAndOutputWithBooleanHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-boolean1"]).toBeDefined(); expect(r.headers["x-boolean1"]).toBe("true"); - expect(r.headers["x-boolean2"]).toBeDefined(); expect(r.headers["x-boolean2"]).toBe("false"); - expect(r.headers["x-booleanlist"]).toBeDefined(); expect(r.headers["x-booleanlist"]).toBe("true, false, true"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3618,7 +3675,6 @@ it("RestJsonInputAndOutputWithTimestampHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-timestamplist"]).toBeDefined(); expect(r.headers["x-timestamplist"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3651,9 +3707,7 @@ it("RestJsonInputAndOutputWithEnumHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-enum"]).toBeDefined(); expect(r.headers["x-enum"]).toBe("Foo"); - expect(r.headers["x-enumlist"]).toBeDefined(); expect(r.headers["x-enumlist"]).toBe("Foo, Bar, Baz"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3686,9 +3740,7 @@ it("RestJsonInputAndOutputWithIntEnumHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-integerenum"]).toBeDefined(); expect(r.headers["x-integerenum"]).toBe("1"); - expect(r.headers["x-integerenumlist"]).toBeDefined(); expect(r.headers["x-integerenumlist"]).toBe("1, 2, 3"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3721,9 +3773,7 @@ it("RestJsonSupportsNaNFloatHeaderInputs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-double"]).toBeDefined(); expect(r.headers["x-double"]).toBe("NaN"); - expect(r.headers["x-float"]).toBeDefined(); expect(r.headers["x-float"]).toBe("NaN"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3756,9 +3806,7 @@ it("RestJsonSupportsInfinityFloatHeaderInputs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-double"]).toBeDefined(); expect(r.headers["x-double"]).toBe("Infinity"); - expect(r.headers["x-float"]).toBeDefined(); expect(r.headers["x-float"]).toBe("Infinity"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3791,9 +3839,7 @@ it("RestJsonSupportsNegativeInfinityFloatHeaderInputs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-double"]).toBeDefined(); expect(r.headers["x-double"]).toBe("-Infinity"); - expect(r.headers["x-float"]).toBeDefined(); expect(r.headers["x-float"]).toBe("-Infinity"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3832,7 +3878,10 @@ it("RestJsonInputAndOutputWithStringHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3865,7 +3914,10 @@ it("RestJsonInputAndOutputWithQuotedStringHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3910,7 +3962,10 @@ it("RestJsonInputAndOutputWithNumericHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3947,7 +4002,10 @@ it("RestJsonInputAndOutputWithBooleanHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3980,7 +4038,10 @@ it("RestJsonInputAndOutputWithTimestampHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4015,7 +4076,10 @@ it("RestJsonInputAndOutputWithEnumHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4050,7 +4114,10 @@ it("RestJsonInputAndOutputWithIntEnumHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4085,7 +4152,10 @@ it("RestJsonSupportsNaNFloatHeaderOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4120,7 +4190,10 @@ it("RestJsonSupportsInfinityFloatHeaderOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4155,7 +4228,10 @@ it("RestJsonSupportsNegativeInfinityFloatHeaderOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4185,10 +4261,9 @@ it("RestJsonJsonBlobs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/JsonBlobs"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"data\": \"dmFsdWU=\" @@ -4233,7 +4308,10 @@ it("RestJsonJsonBlobs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4271,10 +4349,9 @@ it("RestJsonJsonEnums:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonEnums"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"fooEnum1\": \"Foo\", @@ -4355,7 +4432,10 @@ it("RestJsonJsonEnums:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4393,10 +4473,9 @@ it("RestJsonJsonIntEnums:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonIntEnums"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"integerEnum1\": 1, @@ -4479,7 +4558,10 @@ it("RestJsonJsonIntEnums:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4529,10 +4611,9 @@ it("RestJsonLists:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonLists"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"stringList\": [ @@ -4614,10 +4695,9 @@ it("RestJsonListsEmpty:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonLists"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"stringList\": [] @@ -4729,7 +4809,10 @@ it("RestJsonLists:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4769,7 +4852,10 @@ it("RestJsonListsEmpty:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4806,10 +4892,9 @@ it("RestJsonJsonMaps:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/JsonMaps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"denseStructMap\": { @@ -4856,10 +4941,9 @@ it("RestJsonSerializesZeroValuesInMaps:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/JsonMaps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"denseNumberMap\": { @@ -4902,10 +4986,9 @@ it("RestJsonSerializesDenseSetMap:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/JsonMaps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"denseSetMap\": { @@ -4967,7 +5050,10 @@ it("RestJsonJsonMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5017,7 +5103,10 @@ it("RestJsonDeserializesZeroValuesInMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5063,7 +5152,10 @@ it("RestJsonDeserializesDenseSetMap:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5111,7 +5203,10 @@ it("RestJsonDeserializesDenseSetMapAndSkipsNull:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5141,10 +5236,9 @@ it("RestJsonJsonTimestamps:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/JsonTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"normal\": 1398796238 @@ -5179,10 +5273,9 @@ it("RestJsonJsonTimestampsWithDateTimeFormat:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/JsonTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"dateTime\": \"2014-04-29T18:30:38Z\" @@ -5217,10 +5310,9 @@ it("RestJsonJsonTimestampsWithDateTimeOnTargetFormat:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/JsonTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"dateTimeOnTarget\": \"2014-04-29T18:30:38Z\" @@ -5255,10 +5347,9 @@ it("RestJsonJsonTimestampsWithEpochSecondsFormat:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/JsonTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"epochSeconds\": 1398796238 @@ -5293,10 +5384,9 @@ it("RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/JsonTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"epochSecondsOnTarget\": 1398796238 @@ -5331,10 +5421,9 @@ it("RestJsonJsonTimestampsWithHttpDateFormat:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/JsonTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"httpDate\": \"Tue, 29 Apr 2014 18:30:38 GMT\" @@ -5369,10 +5458,9 @@ it("RestJsonJsonTimestampsWithHttpDateOnTargetFormat:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/JsonTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"httpDateOnTarget\": \"Tue, 29 Apr 2014 18:30:38 GMT\" @@ -5417,7 +5505,10 @@ it("RestJsonJsonTimestamps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5457,7 +5548,10 @@ it("RestJsonJsonTimestampsWithDateTimeFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5497,7 +5591,10 @@ it("RestJsonJsonTimestampsWithDateTimeOnTargetFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5537,7 +5634,10 @@ it("RestJsonJsonTimestampsWithEpochSecondsFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5577,7 +5677,10 @@ it("RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat:Response", async () => }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5617,7 +5720,10 @@ it("RestJsonJsonTimestampsWithHttpDateFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5657,7 +5763,10 @@ it("RestJsonJsonTimestampsWithHttpDateOnTargetFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5689,10 +5798,9 @@ it("RestJsonSerializeStringUnionValue:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -5731,10 +5839,9 @@ it("RestJsonSerializeBooleanUnionValue:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -5773,10 +5880,9 @@ it("RestJsonSerializeNumberUnionValue:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -5815,10 +5921,9 @@ it("RestJsonSerializeBlobUnionValue:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -5857,10 +5962,9 @@ it("RestJsonSerializeTimestampUnionValue:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -5899,10 +6003,9 @@ it("RestJsonSerializeEnumUnionValue:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -5941,10 +6044,9 @@ it("RestJsonSerializeListUnionValue:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -5986,10 +6088,9 @@ it("RestJsonSerializeMapUnionValue:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -6033,10 +6134,9 @@ it("RestJsonSerializeStructureUnionValue:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -6079,10 +6179,9 @@ it("RestJsonSerializeRenamedStructureUnionValue:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/JsonUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"contents\": { @@ -6135,7 +6234,10 @@ it("RestJsonDeserializeStringUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6179,7 +6281,10 @@ it("RestJsonDeserializeBooleanUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6223,7 +6328,10 @@ it("RestJsonDeserializeNumberUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6267,7 +6375,10 @@ it("RestJsonDeserializeBlobUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6311,7 +6422,10 @@ it("RestJsonDeserializeTimestampUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6355,7 +6469,10 @@ it("RestJsonDeserializeEnumUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6399,7 +6516,10 @@ it("RestJsonDeserializeListUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6449,7 +6569,10 @@ it("RestJsonDeserializeMapUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6497,7 +6620,10 @@ it("RestJsonDeserializeStructureUnionValue:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6546,7 +6672,10 @@ it("RestJsonDeserializeIgnoreType:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6576,7 +6705,6 @@ it("MediaTypeHeaderInputBase64:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/MediaTypeHeader"); - expect(r.headers["x-json"]).toBeDefined(); expect(r.headers["x-json"]).toBe("dHJ1ZQ=="); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -6611,7 +6739,10 @@ it("MediaTypeHeaderOutputBase64:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6779,11 +6910,12 @@ it.skip("RestJsonNullAndEmptyHeaders:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/NullAndEmptyHeadersClient"); - expect(r.headers["x-a"]).toBeUndefined(); + expect( + r.headers["x-a"], + `Header key "x-a" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); - expect(r.headers["x-b"]).toBeDefined(); expect(r.headers["x-b"]).toBe(""); - expect(r.headers["x-c"]).toBeDefined(); expect(r.headers["x-c"]).toBe(""); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -6911,10 +7043,9 @@ it.skip("RestJsonClientPopulatesDefaultValuesInInput:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/OperationWithDefaults"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"defaults\": { @@ -6975,10 +7106,9 @@ it.skip("RestJsonClientSkipsTopLevelDefaultValuesInInput:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/OperationWithDefaults"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ }`; @@ -7045,10 +7175,9 @@ it.skip("RestJsonClientUsesExplicitlyProvidedMemberValuesOverDefaults:Request", expect(r.method).toBe("POST"); expect(r.path).toBe("/OperationWithDefaults"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"defaults\": { @@ -7113,10 +7242,9 @@ it.skip("RestJsonClientUsesExplicitlyProvidedValuesInTopLevel:Request", async () expect(r.method).toBe("POST"); expect(r.path).toBe("/OperationWithDefaults"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"topLevelDefault\": \"hi\", @@ -7152,10 +7280,9 @@ it.skip("RestJsonClientIgnoresNonTopLevelDefaultsOnMembersWithClientOptional:Req expect(r.method).toBe("POST"); expect(r.path).toBe("/OperationWithDefaults"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"clientOptionalDefaults\": {} @@ -7224,7 +7351,10 @@ it.skip("RestJsonClientPopulatesDefaultsValuesWhenMissingInResponse:Response", a }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7322,7 +7452,10 @@ it.skip("RestJsonClientIgnoresDefaultValuesIfMemberValuesArePresentInResponse:Re }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7382,10 +7515,9 @@ it.skip("RestJsonClientPopulatesNestedDefaultValuesWhenMissing:Request", async ( expect(r.method).toBe("POST"); expect(r.path).toBe("/OperationWithNestedStructure"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"topLevel\": { @@ -7540,7 +7672,10 @@ it.skip("RestJsonClientPopulatesNestedDefaultsWhenMissingInResponseBody:Response }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7572,10 +7707,9 @@ it("RestJsonInputUnionWithUnitMember:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/PostPlayerAction"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"action\": { @@ -7626,7 +7760,10 @@ it("RestJsonOutputUnionWithUnitMember:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7658,10 +7795,9 @@ it("PostUnionWithJsonNameRequest1:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/PostUnionWithJsonName"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"value\": { @@ -7700,10 +7836,9 @@ it("PostUnionWithJsonNameRequest2:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/PostUnionWithJsonName"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"value\": { @@ -7742,10 +7877,9 @@ it("PostUnionWithJsonNameRequest3:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/PostUnionWithJsonName"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"value\": { @@ -7796,7 +7930,10 @@ it("PostUnionWithJsonNameResponse1:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7840,7 +7977,10 @@ it("PostUnionWithJsonNameResponse2:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7884,7 +8024,10 @@ it("PostUnionWithJsonNameResponse3:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7914,7 +8057,6 @@ it("SDKAppliedContentEncoding_restJson1:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/requestcompression/putcontentwithencoding"); - expect(r.headers["content-encoding"]).toBeDefined(); expect(r.headers["content-encoding"]).toBe("gzip"); } }); @@ -7948,7 +8090,6 @@ it("SDKAppendedGzipAfterProvidedEncoding_restJson1:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/requestcompression/putcontentwithencoding"); - expect(r.headers["content-encoding"]).toBeDefined(); expect(r.headers["content-encoding"]).toBe("custom, gzip"); } }); @@ -8127,10 +8268,9 @@ it("RestJsonRecursiveShapes:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/RecursiveShapes"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"nested\": { @@ -8208,7 +8348,10 @@ it("RestJsonRecursiveShapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -8247,12 +8390,10 @@ it("RestJsonSimpleScalarProperties:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SimpleScalarProperties"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"stringValue\": \"string\", @@ -8295,10 +8436,9 @@ it("RestJsonDoesntSerializeNullStructureValues:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SimpleScalarProperties"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -8332,10 +8472,9 @@ it("RestJsonSupportsNaNFloatInputs:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SimpleScalarProperties"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"floatValue\": \"NaN\", @@ -8372,10 +8511,9 @@ it("RestJsonSupportsInfinityFloatInputs:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SimpleScalarProperties"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"floatValue\": \"Infinity\", @@ -8412,10 +8550,9 @@ it("RestJsonSupportsNegativeInfinityFloatInputs:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SimpleScalarProperties"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"floatValue\": \"-Infinity\", @@ -8479,7 +8616,10 @@ it("RestJsonSimpleScalarProperties:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -8552,7 +8692,10 @@ it("RestJsonSupportsNaNFloatInputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -8594,7 +8737,10 @@ it("RestJsonSupportsInfinityFloatInputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -8636,7 +8782,10 @@ it("RestJsonSupportsNegativeInfinityFloatInputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -8667,10 +8816,9 @@ it("RestJsonSparseListsSerializeNull:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SparseJsonLists"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"sparseStringList\": [ @@ -8730,7 +8878,10 @@ it("RestJsonSparseListsSerializeNull:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -8767,10 +8918,9 @@ it("RestJsonSparseJsonMaps:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/SparseJsonMaps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"sparseStructMap\": { @@ -8823,10 +8973,9 @@ it("RestJsonSerializesSparseNullMapValues:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/SparseJsonMaps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"sparseBooleanMap\": { @@ -8877,10 +9026,9 @@ it("RestJsonSerializesZeroValuesInSparseMaps:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/SparseJsonMaps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"sparseNumberMap\": { @@ -8923,10 +9071,9 @@ it("RestJsonSerializesSparseSetMap:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/SparseJsonMaps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"sparseSetMap\": { @@ -8968,10 +9115,9 @@ it("RestJsonSerializesSparseSetMapAndRetainsNull:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/SparseJsonMaps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{ \"sparseSetMap\": { @@ -9034,7 +9180,10 @@ it("RestJsonSparseJsonMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -9096,7 +9245,10 @@ it("RestJsonDeserializesSparseNullMapValues:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -9146,7 +9298,10 @@ it("RestJsonDeserializesZeroValuesInSparseMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -9192,7 +9347,10 @@ it("RestJsonDeserializesSparseSetMap:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -9240,7 +9398,10 @@ it("RestJsonDeserializesSparseSetMapAndRetainsNull:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -9271,12 +9432,10 @@ it("RestJsonStreamingTraitsWithBlob:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/StreamingTraits"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/octet-stream"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `blobby blob blob`; const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); @@ -9309,7 +9468,6 @@ it("RestJsonStreamingTraitsWithNoBlobBody:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/StreamingTraits"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -9352,7 +9510,10 @@ it("RestJsonStreamingTraitsWithBlob:Response", async () => { ][0]; const comparableBlob = await client.config.streamCollector(r["blob"]); Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); if (param === "blob") { expect(equivalentContents(paramsToValidate[param], comparableBlob)).toBe(true); } else { @@ -9395,7 +9556,10 @@ it("RestJsonStreamingTraitsWithNoBlobBody:Response", async () => { ][0]; const comparableBlob = await client.config.streamCollector(r["blob"]); Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); if (param === "blob") { expect(equivalentContents(paramsToValidate[param], comparableBlob)).toBe(true); } else { @@ -9429,14 +9593,15 @@ it("RestJsonStreamingTraitsRequireLengthWithBlob:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/StreamingTraitsRequireLength"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/octet-stream"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `blobby blob blob`; const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); @@ -9469,7 +9634,6 @@ it("RestJsonStreamingTraitsRequireLengthWithNoBlobBody:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/StreamingTraitsRequireLength"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -9502,12 +9666,10 @@ it("RestJsonStreamingTraitsWithMediaTypeWithBlob:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/StreamingTraitsWithMediaType"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("text/plain"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `blobby blob blob`; const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); @@ -9551,7 +9713,10 @@ it("RestJsonStreamingTraitsWithMediaTypeWithBlob:Response", async () => { ][0]; const comparableBlob = await client.config.streamCollector(r["blob"]); Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); if (param === "blob") { expect(equivalentContents(paramsToValidate[param], comparableBlob)).toBe(true); } else { @@ -9586,12 +9751,14 @@ it("RestJsonTestBodyStructure:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/body"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"testConfig\": {\"timeout\": 10} @@ -9623,12 +9790,14 @@ it("RestJsonHttpWithEmptyBody:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/body"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -9659,8 +9828,14 @@ it("RestJsonHttpGetWithNoInput:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/no_input_no_payload"); - expect(r.headers["content-type"]).toBeUndefined(); - expect(r.headers["content-length"]).toBeUndefined(); + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); expect(!r.body || r.body === `{}`).toBeTruthy(); } @@ -9689,8 +9864,14 @@ it("RestJsonHttpGetWithNoModeledBody:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/no_payload"); - expect(r.headers["content-length"]).toBeUndefined(); - expect(r.headers["content-type"]).toBeUndefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); expect(!r.body || r.body === `{}`).toBeTruthy(); } @@ -9721,10 +9902,15 @@ it("RestJsonHttpGetWithHeaderMemberNoModeledBody:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/no_payload"); - expect(r.headers["content-length"]).toBeUndefined(); - expect(r.headers["content-type"]).toBeUndefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); - expect(r.headers["x-amz-test-id"]).toBeDefined(); expect(r.headers["x-amz-test-id"]).toBe("t-12345"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -9783,12 +9969,14 @@ it("RestJsonTestPayloadBlob:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/blob_payload"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("image/jpg"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `1234`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -9818,12 +10006,14 @@ it("RestJsonHttpWithEmptyStructurePayload:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/payload"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -9857,12 +10047,14 @@ it("RestJsonTestPayloadStructure:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/payload"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{\"data\": 25 }`; @@ -9895,14 +10087,15 @@ it("RestJsonHttpWithHeadersButNoPayload:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/payload"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.headers["x-amz-test-id"]).toBeDefined(); expect(r.headers["x-amz-test-id"]).toBe("t-12345"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -9933,7 +10126,10 @@ it("RestJsonHttpPostWithNoInput:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/no_input_no_payload"); - expect(r.headers["content-type"]).toBeUndefined(); + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); expect(!r.body || r.body === `{}`).toBeTruthy(); } @@ -9962,7 +10158,10 @@ it("RestJsonHttpPostWithNoModeledBody:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/no_payload"); - expect(r.headers["content-type"]).toBeUndefined(); + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); expect(!r.body || r.body === `{}`).toBeTruthy(); } @@ -9993,9 +10192,11 @@ it("RestJsonHttpWithPostHeaderMemberNoModeledBody:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/no_payload"); - expect(r.headers["content-type"]).toBeUndefined(); + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); - expect(r.headers["x-amz-test-id"]).toBeDefined(); expect(r.headers["x-amz-test-id"]).toBe("t-12345"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -10033,19 +10234,12 @@ it("RestJsonTimestampFormatHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/TimestampFormatHeaders"); - expect(r.headers["x-defaultformat"]).toBeDefined(); expect(r.headers["x-defaultformat"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); - expect(r.headers["x-memberdatetime"]).toBeDefined(); expect(r.headers["x-memberdatetime"]).toBe("2019-12-16T23:48:18Z"); - expect(r.headers["x-memberepochseconds"]).toBeDefined(); expect(r.headers["x-memberepochseconds"]).toBe("1576540098"); - expect(r.headers["x-memberhttpdate"]).toBeDefined(); expect(r.headers["x-memberhttpdate"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); - expect(r.headers["x-targetdatetime"]).toBeDefined(); expect(r.headers["x-targetdatetime"]).toBe("2019-12-16T23:48:18Z"); - expect(r.headers["x-targetepochseconds"]).toBeDefined(); expect(r.headers["x-targetepochseconds"]).toBe("1576540098"); - expect(r.headers["x-targethttpdate"]).toBeDefined(); expect(r.headers["x-targethttpdate"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -10092,7 +10286,10 @@ it("RestJsonTimestampFormatHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); diff --git a/private/aws-protocoltests-restjson/vite.config.js b/private/aws-protocoltests-restjson/vite.config.js new file mode 100644 index 000000000000..e7147d3ac9e1 --- /dev/null +++ b/private/aws-protocoltests-restjson/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-restxml/package.json b/private/aws-protocoltests-restxml/package.json index 4b9bfcb63462..03684d34788f 100644 --- a/private/aws-protocoltests-restxml/package.json +++ b/private/aws-protocoltests-restxml/package.json @@ -69,7 +69,8 @@ "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "vitest": "2.1.8" }, "engines": { "node": ">=18.0.0" diff --git a/private/aws-protocoltests-restxml/test/functional/restxml.spec.ts b/private/aws-protocoltests-restxml/test/functional/restxml.spec.ts index 9f7c72291c66..49a6023682ce 100644 --- a/private/aws-protocoltests-restxml/test/functional/restxml.spec.ts +++ b/private/aws-protocoltests-restxml/test/functional/restxml.spec.ts @@ -6,6 +6,7 @@ import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; import { decodeHTML } from "entities"; import { XMLParser } from "fast-xml-parser"; import { Readable } from "stream"; +import { expect, test as it } from "vitest"; import { AllQueryStringTypesCommand } from "../../src/commands/AllQueryStringTypesCommand"; import { BodyWithXmlNameCommand } from "../../src/commands/BodyWithXmlNameCommand"; @@ -582,12 +583,14 @@ it("BodyWithXmlName:Request", async () => { const r = err.request; expect(r.method).toBe("PUT"); expect(r.path).toBe("/BodyWithXmlName"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Phreddy`; const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); @@ -630,7 +633,10 @@ it("BodyWithXmlName:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -660,7 +666,10 @@ it("ConstantAndVariableQueryStringMissingOneValue:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/ConstantAndVariableQueryString"); - expect(r.query["maybeSet"]).toBeUndefined(); + expect( + r.query["maybeSet"], + `Query key "maybeSet" should have been undefined in ${JSON.stringify(r.query)}` + ).toBeUndefined(); const queryString = buildQueryString(r.query); expect(queryString).toContain("foo=bar"); @@ -774,7 +783,10 @@ it("RestXmlDateTimeWithNegativeOffset:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -815,7 +827,10 @@ it("RestXmlDateTimeWithPositiveOffset:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -894,7 +909,6 @@ it("RestXmlEndpointTrait:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/EndpointOperation"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("foo.example.com"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -931,10 +945,8 @@ it("RestXmlEndpointTraitWithHostLabelAndHttpBinding:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/EndpointWithHostLabelHeaderOperation"); - expect(r.headers["x-amz-account-id"]).toBeDefined(); expect(r.headers["x-amz-account-id"]).toBe("bar"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("bar.example.com"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -969,10 +981,9 @@ it("RestXmlEndpointTraitWithHostLabel:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/EndpointWithHostLabelOperation"); - expect(r.headers["host"]).toBeDefined(); expect(r.headers["host"]).toBe("foo.bar.example.com"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -1011,10 +1022,9 @@ it("FlattenedXmlMap:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/FlattenedXmlMap"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -1076,7 +1086,10 @@ it("FlattenedXmlMap:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1109,10 +1122,9 @@ it("FlattenedXmlMapWithXmlName:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/FlattenedXmlMapWithXmlName"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -1174,7 +1186,10 @@ it("FlattenedXmlMapWithXmlName:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1224,7 +1239,10 @@ it("RestXmlFlattenedXmlMapWithXmlNamespace:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1265,7 +1283,10 @@ it("RestXmlDateTimeWithFractionalSeconds:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1303,7 +1324,10 @@ it("GreetingWithErrors:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1352,7 +1376,10 @@ it("InvalidGreetingError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -1409,7 +1436,10 @@ it("ComplexError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -1439,10 +1469,9 @@ it("RestXmlEnumPayloadRequest:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/EnumPayload"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("text/plain"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `enumvalue`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -1480,7 +1509,10 @@ it("RestXmlEnumPayloadResponse:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1510,12 +1542,14 @@ it("HttpPayloadTraitsWithBlob:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/HttpPayloadTraits"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `blobby blob blob`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -1548,7 +1582,6 @@ it("HttpPayloadTraitsWithNoBlobBody:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/HttpPayloadTraits"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -1589,7 +1622,10 @@ it("HttpPayloadTraitsWithBlob:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1627,7 +1663,10 @@ it("HttpPayloadTraitsWithNoBlobBody:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1657,14 +1696,15 @@ it("HttpPayloadTraitsWithMediaTypeWithBlob:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/HttpPayloadTraitsWithMediaType"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("text/plain"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `blobby blob blob`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -1707,7 +1747,10 @@ it("HttpPayloadTraitsWithMediaTypeWithBlob:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1738,12 +1781,14 @@ it("HttpPayloadWithMemberXmlName:Request", async () => { const r = err.request; expect(r.method).toBe("PUT"); expect(r.path).toBe("/HttpPayloadWithMemberXmlName"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Phreddy`; const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); @@ -1786,7 +1831,10 @@ it("HttpPayloadWithMemberXmlName:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1818,12 +1866,14 @@ it("HttpPayloadWithStructure:Request", async () => { const r = err.request; expect(r.method).toBe("PUT"); expect(r.path).toBe("/HttpPayloadWithStructure"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` hello @@ -1875,7 +1925,10 @@ it("HttpPayloadWithStructure:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1906,12 +1959,14 @@ it("RestXmlHttpPayloadWithUnion:Request", async () => { const r = err.request; expect(r.method).toBe("PUT"); expect(r.path).toBe("/HttpPayloadWithUnion"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` hello @@ -1985,7 +2040,10 @@ it("RestXmlHttpPayloadWithUnion:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2045,12 +2103,14 @@ it("HttpPayloadWithXmlName:Request", async () => { const r = err.request; expect(r.method).toBe("PUT"); expect(r.path).toBe("/HttpPayloadWithXmlName"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `Phreddy`; const unequalParts: any = compareEquivalentXmlBodies(bodyString, r.body.toString()); @@ -2093,7 +2153,10 @@ it("HttpPayloadWithXmlName:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2124,12 +2187,14 @@ it("HttpPayloadWithXmlNamespace:Request", async () => { const r = err.request; expect(r.method).toBe("PUT"); expect(r.path).toBe("/HttpPayloadWithXmlNamespace"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` Phreddy @@ -2176,7 +2241,10 @@ it("HttpPayloadWithXmlNamespace:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2207,12 +2275,14 @@ it("HttpPayloadWithXmlNamespaceAndPrefix:Request", async () => { const r = err.request; expect(r.method).toBe("PUT"); expect(r.path).toBe("/HttpPayloadWithXmlNamespaceAndPrefix"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` Phreddy @@ -2259,7 +2329,10 @@ it("HttpPayloadWithXmlNamespaceAndPrefix:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2293,11 +2366,8 @@ it("HttpPrefixHeadersArePresent:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/HttpPrefixHeaders"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.headers["x-foo-abc"]).toBeDefined(); expect(r.headers["x-foo-abc"]).toBe("Abc value"); - expect(r.headers["x-foo-def"]).toBeDefined(); expect(r.headers["x-foo-def"]).toBe("Def value"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -2330,7 +2400,6 @@ it("HttpPrefixHeadersAreNotPresent:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/HttpPrefixHeaders"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -2364,7 +2433,6 @@ it("HttpPrefixEmptyHeaders:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/HttpPrefixHeaders"); - expect(r.headers["x-foo-abc"]).toBeDefined(); expect(r.headers["x-foo-abc"]).toBe(""); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -2410,7 +2478,10 @@ it("HttpPrefixHeadersArePresent:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2449,7 +2520,10 @@ it("HttpPrefixHeadersAreNotPresent:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2718,7 +2792,10 @@ it("RestXmlHttpResponseCode:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2745,10 +2822,9 @@ it("RestXmlStringPayloadRequest:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/StringPayload"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("text/plain"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = `rawstring`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -2786,7 +2862,10 @@ it("RestXmlStringPayloadResponse:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2824,7 +2903,10 @@ it("IgnoreQueryParamsInResponse:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2856,11 +2938,8 @@ it("InputAndOutputWithStringHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-string"]).toBeDefined(); expect(r.headers["x-string"]).toBe("Hello"); - expect(r.headers["x-stringlist"]).toBeDefined(); expect(r.headers["x-stringlist"]).toBe("a, b, c"); - expect(r.headers["x-stringset"]).toBeDefined(); expect(r.headers["x-stringset"]).toBe("a, b, c"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -2898,19 +2977,12 @@ it("InputAndOutputWithNumericHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-byte"]).toBeDefined(); expect(r.headers["x-byte"]).toBe("1"); - expect(r.headers["x-double"]).toBeDefined(); expect(r.headers["x-double"]).toBe("1.1"); - expect(r.headers["x-float"]).toBeDefined(); expect(r.headers["x-float"]).toBe("1.1"); - expect(r.headers["x-integer"]).toBeDefined(); expect(r.headers["x-integer"]).toBe("123"); - expect(r.headers["x-integerlist"]).toBeDefined(); expect(r.headers["x-integerlist"]).toBe("1, 2, 3"); - expect(r.headers["x-long"]).toBeDefined(); expect(r.headers["x-long"]).toBe("123"); - expect(r.headers["x-short"]).toBeDefined(); expect(r.headers["x-short"]).toBe("123"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -2944,11 +3016,8 @@ it("InputAndOutputWithBooleanHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-boolean1"]).toBeDefined(); expect(r.headers["x-boolean1"]).toBe("true"); - expect(r.headers["x-boolean2"]).toBeDefined(); expect(r.headers["x-boolean2"]).toBe("false"); - expect(r.headers["x-booleanlist"]).toBeDefined(); expect(r.headers["x-booleanlist"]).toBe("true, false, true"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -2980,7 +3049,6 @@ it("InputAndOutputWithTimestampHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-timestamplist"]).toBeDefined(); expect(r.headers["x-timestamplist"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3013,9 +3081,7 @@ it("InputAndOutputWithEnumHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-enum"]).toBeDefined(); expect(r.headers["x-enum"]).toBe("Foo"); - expect(r.headers["x-enumlist"]).toBeDefined(); expect(r.headers["x-enumlist"]).toBe("Foo, Bar, Baz"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3048,9 +3114,7 @@ it("RestXmlSupportsNaNFloatHeaderInputs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-double"]).toBeDefined(); expect(r.headers["x-double"]).toBe("NaN"); - expect(r.headers["x-float"]).toBeDefined(); expect(r.headers["x-float"]).toBe("NaN"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3083,9 +3147,7 @@ it("RestXmlSupportsInfinityFloatHeaderInputs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-double"]).toBeDefined(); expect(r.headers["x-double"]).toBe("Infinity"); - expect(r.headers["x-float"]).toBeDefined(); expect(r.headers["x-float"]).toBe("Infinity"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3118,9 +3180,7 @@ it("RestXmlSupportsNegativeInfinityFloatHeaderInputs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/InputAndOutputWithHeaders"); - expect(r.headers["x-double"]).toBeDefined(); expect(r.headers["x-double"]).toBe("-Infinity"); - expect(r.headers["x-float"]).toBeDefined(); expect(r.headers["x-float"]).toBe("-Infinity"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3164,7 +3224,10 @@ it("InputAndOutputWithStringHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3214,7 +3277,10 @@ it("InputAndOutputWithNumericHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3256,7 +3322,10 @@ it("InputAndOutputWithBooleanHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3294,7 +3363,10 @@ it("InputAndOutputWithTimestampHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3334,7 +3406,10 @@ it("InputAndOutputWithEnumHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3374,7 +3449,10 @@ it("RestXmlSupportsNaNFloatHeaderOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3414,7 +3492,10 @@ it("RestXmlSupportsInfinityFloatHeaderOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3454,7 +3535,10 @@ it("RestXmlSupportsNegativeInfinityFloatHeaderOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3488,10 +3572,9 @@ it("NestedXmlMapRequest:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/NestedXmlMaps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -3541,10 +3624,9 @@ it("FlatNestedXmlMapRequest:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/NestedXmlMaps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -3611,7 +3693,10 @@ it("NestedXmlMapResponse:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3664,7 +3749,10 @@ it("FlatNestedXmlMapResponse:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3703,10 +3791,9 @@ it.skip("NestedXmlMapWithXmlNameSerializes:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/NestedXmlMapWithXmlName"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -3816,7 +3903,10 @@ it("NestedXmlMapWithXmlNameDeserializes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3946,11 +4036,12 @@ it.skip("NullAndEmptyHeaders:Request", async () => { expect(r.method).toBe("GET"); expect(r.path).toBe("/NullAndEmptyHeadersClient"); - expect(r.headers["x-a"]).toBeUndefined(); + expect( + r.headers["x-a"], + `Header key "x-a" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); - expect(r.headers["x-b"]).toBeDefined(); expect(r.headers["x-b"]).toBe(""); - expect(r.headers["x-c"]).toBeDefined(); expect(r.headers["x-c"]).toBe(""); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -4043,7 +4134,6 @@ it("SDKAppliedContentEncoding_restXml:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/requestcompression/putcontentwithencoding"); - expect(r.headers["content-encoding"]).toBeDefined(); expect(r.headers["content-encoding"]).toBe("gzip"); } }); @@ -4077,7 +4167,6 @@ it("SDKAppendedGzipAfterProvidedEncoding_restXml:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/requestcompression/putcontentwithencoding"); - expect(r.headers["content-encoding"]).toBeDefined(); expect(r.headers["content-encoding"]).toBe("custom, gzip"); } }); @@ -4256,10 +4345,9 @@ it("RecursiveShapes:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/RecursiveShapes"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -4339,7 +4427,10 @@ it("RecursiveShapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4378,12 +4469,10 @@ it("SimpleScalarProperties:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SimpleScalarProperties"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` string @@ -4428,12 +4517,10 @@ it("SimpleScalarPropertiesWithEscapedCharacter:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SimpleScalarProperties"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` <string> @@ -4470,12 +4557,10 @@ it("SimpleScalarPropertiesWithWhiteSpace:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SimpleScalarProperties"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` string with white space @@ -4512,12 +4597,10 @@ it("SimpleScalarPropertiesPureWhiteSpace:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SimpleScalarProperties"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -4554,10 +4637,9 @@ it("RestXmlSupportsNaNFloatInputs:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SimpleScalarProperties"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` NaN @@ -4595,10 +4677,9 @@ it("RestXmlSupportsInfinityFloatInputs:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SimpleScalarProperties"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` Infinity @@ -4636,10 +4717,9 @@ it("RestXmlSupportsNegativeInfinityFloatInputs:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/SimpleScalarProperties"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` -Infinity @@ -4705,7 +4785,10 @@ it("SimpleScalarProperties:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4754,7 +4837,10 @@ it("SimpleScalarPropertiesComplexEscapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4797,7 +4883,10 @@ it("SimpleScalarPropertiesWithEscapedCharacter:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4843,7 +4932,10 @@ it("SimpleScalarPropertiesWithXMLPreamble:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4887,7 +4979,10 @@ it("SimpleScalarPropertiesWithWhiteSpace:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4931,7 +5026,10 @@ it("SimpleScalarPropertiesPureWhiteSpace:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4974,7 +5072,10 @@ it("RestXmlSupportsNaNFloatOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5017,7 +5118,10 @@ it("RestXmlSupportsInfinityFloatOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5060,7 +5164,10 @@ it("RestXmlSupportsNegativeInfinityFloatOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5096,19 +5203,12 @@ it("TimestampFormatHeaders:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/TimestampFormatHeaders"); - expect(r.headers["x-defaultformat"]).toBeDefined(); expect(r.headers["x-defaultformat"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); - expect(r.headers["x-memberdatetime"]).toBeDefined(); expect(r.headers["x-memberdatetime"]).toBe("2019-12-16T23:48:18Z"); - expect(r.headers["x-memberepochseconds"]).toBeDefined(); expect(r.headers["x-memberepochseconds"]).toBe("1576540098"); - expect(r.headers["x-memberhttpdate"]).toBeDefined(); expect(r.headers["x-memberhttpdate"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); - expect(r.headers["x-targetdatetime"]).toBeDefined(); expect(r.headers["x-targetdatetime"]).toBe("2019-12-16T23:48:18Z"); - expect(r.headers["x-targetepochseconds"]).toBeDefined(); expect(r.headers["x-targetepochseconds"]).toBe("1576540098"); - expect(r.headers["x-targethttpdate"]).toBeDefined(); expect(r.headers["x-targethttpdate"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -5160,7 +5260,10 @@ it("TimestampFormatHeaders:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5191,10 +5294,9 @@ it("XmlAttributes:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/XmlAttributes"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` hi @@ -5231,10 +5333,9 @@ it("XmlAttributesWithEscaping:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/XmlAttributes"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` hi @@ -5282,7 +5383,10 @@ it("XmlAttributes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5315,10 +5419,9 @@ it("XmlAttributesOnPayload:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/XmlAttributesOnPayload"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` hi @@ -5368,7 +5471,10 @@ it("XmlAttributesOnPayload:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5398,10 +5504,9 @@ it("XmlBlobs:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlBlobs"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` dmFsdWU= @@ -5448,7 +5553,10 @@ it("XmlBlobs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5489,7 +5597,10 @@ it("XmlEmptyBlobs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5530,7 +5641,10 @@ it("XmlEmptySelfClosedBlobs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5561,10 +5675,9 @@ it("XmlEmptyLists:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/XmlEmptyLists"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -5614,7 +5727,10 @@ it("XmlEmptyLists:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5644,10 +5760,9 @@ it("XmlEmptyMaps:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlEmptyMaps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -5694,7 +5809,10 @@ it("XmlEmptyMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5735,7 +5853,10 @@ it("XmlEmptySelfClosedMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5765,10 +5886,9 @@ it("XmlEmptyStrings:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/XmlEmptyStrings"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -5815,7 +5935,10 @@ it("XmlEmptyStrings:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5856,7 +5979,10 @@ it("XmlEmptySelfClosedStrings:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5894,10 +6020,9 @@ it("XmlEnums:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/XmlEnums"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` Foo @@ -5992,7 +6117,10 @@ it("XmlEnums:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6030,10 +6158,9 @@ it("XmlIntEnums:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/XmlIntEnums"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` 1 @@ -6128,7 +6255,10 @@ it("XmlIntEnums:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6191,10 +6321,9 @@ it("XmlLists:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/XmlLists"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -6406,7 +6535,10 @@ it("XmlLists:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6443,10 +6575,9 @@ it("XmlMaps:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlMaps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -6526,7 +6657,10 @@ it("XmlMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6563,10 +6697,9 @@ it("XmlMapsXmlName:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlMapsXmlName"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -6646,7 +6779,10 @@ it("XmlMapsXmlName:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6679,10 +6815,9 @@ it("RestXmlXmlMapWithXmlNamespace:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlMapWithXmlNamespace"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -6748,7 +6883,10 @@ it("RestXmlXmlMapWithXmlNamespace:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6781,10 +6919,9 @@ it("XmlNamespaces:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlNamespaces"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -6846,7 +6983,10 @@ it("XmlNamespaces:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6876,10 +7016,9 @@ it("XmlTimestamps:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` 2014-04-29T18:30:38Z @@ -6915,10 +7054,9 @@ it("XmlTimestampsWithDateTimeFormat:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` 2014-04-29T18:30:38Z @@ -6954,10 +7092,9 @@ it("XmlTimestampsWithDateTimeOnTargetFormat:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` 2014-04-29T18:30:38Z @@ -6993,10 +7130,9 @@ it("XmlTimestampsWithEpochSecondsFormat:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` 1398796238 @@ -7032,10 +7168,9 @@ it("XmlTimestampsWithEpochSecondsOnTargetFormat:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` 1398796238 @@ -7071,10 +7206,9 @@ it("XmlTimestampsWithHttpDateFormat:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` Tue, 29 Apr 2014 18:30:38 GMT @@ -7110,10 +7244,9 @@ it("XmlTimestampsWithHttpDateOnTargetFormat:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/XmlTimestamps"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` Tue, 29 Apr 2014 18:30:38 GMT @@ -7160,7 +7293,10 @@ it("XmlTimestamps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7201,7 +7337,10 @@ it("XmlTimestampsWithDateTimeFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7242,7 +7381,10 @@ it("XmlTimestampsWithDateTimeOnTargetFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7283,7 +7425,10 @@ it("XmlTimestampsWithEpochSecondsFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7324,7 +7469,10 @@ it("XmlTimestampsWithEpochSecondsOnTargetFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7365,7 +7513,10 @@ it("XmlTimestampsWithHttpDateFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7406,7 +7557,10 @@ it("XmlTimestampsWithHttpDateOnTargetFormat:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7447,10 +7601,9 @@ it("XmlUnionsWithStructMember:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/XmlUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -7499,10 +7652,9 @@ it("XmlUnionsWithStringMember:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/XmlUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -7542,10 +7694,9 @@ it("XmlUnionsWithBooleanMember:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/XmlUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -7587,10 +7738,9 @@ it("XmlUnionsWithUnionMember:Request", async () => { expect(r.method).toBe("PUT"); expect(r.path).toBe("/XmlUnions"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/xml"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = client.config.utf8Encoder; const bodyString = ` @@ -7663,7 +7813,10 @@ it("XmlUnionsWithStructMember:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7708,7 +7861,10 @@ it("XmlUnionsWithStringMember:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7753,7 +7909,10 @@ it("XmlUnionsWithBooleanMember:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7802,7 +7961,10 @@ it("XmlUnionsWithUnionMember:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); diff --git a/private/aws-protocoltests-restxml/vite.config.js b/private/aws-protocoltests-restxml/vite.config.js new file mode 100644 index 000000000000..e7147d3ac9e1 --- /dev/null +++ b/private/aws-protocoltests-restxml/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor/package.json b/private/aws-protocoltests-smithy-rpcv2-cbor/package.json index 16659e41e4d6..da21579deed5 100644 --- a/private/aws-protocoltests-smithy-rpcv2-cbor/package.json +++ b/private/aws-protocoltests-smithy-rpcv2-cbor/package.json @@ -58,7 +58,8 @@ "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "vitest": "2.1.8" }, "engines": { "node": ">=18.0.0" diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor/test/functional/rpcv2cbor.spec.ts b/private/aws-protocoltests-smithy-rpcv2-cbor/test/functional/rpcv2cbor.spec.ts index 1cbe7c6b89b2..ccde7bf59540 100644 --- a/private/aws-protocoltests-smithy-rpcv2-cbor/test/functional/rpcv2cbor.spec.ts +++ b/private/aws-protocoltests-smithy-rpcv2-cbor/test/functional/rpcv2cbor.spec.ts @@ -3,6 +3,7 @@ import { cbor } from "@smithy/core/cbor"; import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; import { Readable } from "stream"; +import { expect, test as it } from "vitest"; import { EmptyInputOutputCommand } from "../../src/commands/EmptyInputOutputCommand"; import { Float16Command } from "../../src/commands/Float16Command"; @@ -236,18 +237,21 @@ it("empty_input:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/EmptyInputOutput"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["x-amz-target"]).toBeUndefined(); + expect( + r.headers["x-amz-target"], + `Header key "x-amz-target" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v/8=`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -348,7 +352,10 @@ it("RpcV2CborFloat16Inf:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -387,7 +394,10 @@ it("RpcV2CborFloat16NegInf:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -426,7 +436,10 @@ it("RpcV2CborFloat16LSBNaN:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -465,7 +478,10 @@ it("RpcV2CborFloat16MSBNaN:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -504,7 +520,10 @@ it("RpcV2CborFloat16Subnormal:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -543,7 +562,10 @@ it("RpcV2CborDateTimeWithFractionalSeconds:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -584,7 +606,10 @@ it("RpcV2CborInvalidGreetingError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -631,7 +656,10 @@ it("RpcV2CborComplexError:Error:GreetingWithErrors", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); return; @@ -694,12 +722,16 @@ it("no_input:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/NoInputOutput"); - expect(r.headers["content-type"]).toBeUndefined(); - expect(r.headers["x-amz-target"]).toBeUndefined(); + expect( + r.headers["content-type"], + `Header key "content-type" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); + expect( + r.headers["x-amz-target"], + `Header key "x-amz-target" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -820,16 +852,16 @@ it.skip("RpcV2CborClientPopulatesDefaultValuesInInput:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/OperationWithDefaults"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v2hkZWZhdWx0c79tZGVmYXVsdFN0cmluZ2JoaW5kZWZhdWx0Qm9vbGVhbvVrZGVmYXVsdExpc3Sf/3BkZWZhdWx0VGltZXN0YW1wwQBrZGVmYXVsdEJsb2JDYWJja2RlZmF1bHRCeXRlAWxkZWZhdWx0U2hvcnQBbmRlZmF1bHRJbnRlZ2VyCmtkZWZhdWx0TG9uZxhkbGRlZmF1bHRGbG9hdPo/gAAAbWRlZmF1bHREb3VibGX6P4AAAGpkZWZhdWx0TWFwv/9rZGVmYXVsdEVudW1jRk9PbmRlZmF1bHRJbnRFbnVtAWtlbXB0eVN0cmluZ2BsZmFsc2VCb29sZWFu9GllbXB0eUJsb2JAaHplcm9CeXRlAGl6ZXJvU2hvcnQAa3plcm9JbnRlZ2VyAGh6ZXJvTG9uZwBpemVyb0Zsb2F0+gAAAABqemVyb0RvdWJsZfoAAAAA//8=`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -858,16 +890,16 @@ it.skip("RpcV2CborClientSkipsTopLevelDefaultValuesInInput:Request", async () => const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/OperationWithDefaults"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v/8=`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -924,16 +956,16 @@ it.skip("RpcV2CborClientUsesExplicitlyProvidedMemberValuesOverDefaults:Request", const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/OperationWithDefaults"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v2hkZWZhdWx0c7dtZGVmYXVsdFN0cmluZ2NieWVuZGVmYXVsdEJvb2xlYW71a2RlZmF1bHRMaXN0gWFhcGRlZmF1bHRUaW1lc3RhbXDB+z/wAAAAAAAAa2RlZmF1bHRCbG9iQmhpa2RlZmF1bHRCeXRlAmxkZWZhdWx0U2hvcnQCbmRlZmF1bHRJbnRlZ2VyFGtkZWZhdWx0TG9uZxjIbGRlZmF1bHRGbG9hdPpAAAAAbWRlZmF1bHREb3VibGX7QAAAAAAAAABqZGVmYXVsdE1hcKFkbmFtZWRKYWNra2RlZmF1bHRFbnVtY0JBUm5kZWZhdWx0SW50RW51bQJrZW1wdHlTdHJpbmdjZm9vbGZhbHNlQm9vbGVhbvVpZW1wdHlCbG9iQmhpaHplcm9CeXRlAWl6ZXJvU2hvcnQBa3plcm9JbnRlZ2VyAWh6ZXJvTG9uZwFpemVyb0Zsb2F0+j+AAABqemVyb0RvdWJsZfs/8AAAAAAAAP8=`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -965,16 +997,16 @@ it.skip("RpcV2CborClientUsesExplicitlyProvidedValuesInTopLevel:Request", async ( const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/OperationWithDefaults"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v290b3BMZXZlbERlZmF1bHRiaGl0b3RoZXJUb3BMZXZlbERlZmF1bHQA/w==`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -1005,16 +1037,16 @@ it.skip("RpcV2CborClientIgnoresNonTopLevelDefaultsOnMembersWithClientOptional:Re const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/OperationWithDefaults"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v3ZjbGllbnRPcHRpb25hbERlZmF1bHRzoP8=`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -1077,7 +1109,10 @@ it.skip("RpcV2CborClientPopulatesDefaultsValuesWhenMissingInResponse:Response", }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1140,7 +1175,10 @@ it.skip("RpcV2CborClientIgnoresDefaultValuesIfMemberValuesArePresentInResponse:R }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1168,16 +1206,16 @@ it("optional_input:Request", async () => { expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/OptionalInputOutput"); - expect(r.headers["x-amz-target"]).toBeUndefined(); + expect( + r.headers["x-amz-target"], + `Header key "x-amz-target" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v/8=`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -1249,16 +1287,16 @@ it("RpcV2CborRecursiveShapes:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/RecursiveShapes"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v2ZuZXN0ZWS/Y2Zvb2RGb28xZm5lc3RlZL9jYmFyZEJhcjFvcmVjdXJzaXZlTWVtYmVyv2Nmb29kRm9vMmZuZXN0ZWS/Y2JhcmRCYXIy//////8=`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -1310,7 +1348,10 @@ it("RpcV2CborRecursiveShapes:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1360,7 +1401,10 @@ it("RpcV2CborRecursiveShapesUsingDefiniteLength:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1396,16 +1440,16 @@ it("RpcV2CborMaps:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborDenseMaps"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `oW5kZW5zZVN0cnVjdE1hcKJjZm9voWJoaWV0aGVyZWNiYXqhYmhpY2J5ZQ==`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -1441,16 +1485,16 @@ it("RpcV2CborSerializesZeroValuesInMaps:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborDenseMaps"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `om5kZW5zZU51bWJlck1hcKFheABvZGVuc2VCb29sZWFuTWFwoWF49A==`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -1484,16 +1528,16 @@ it("RpcV2CborSerializesDenseSetMap:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborDenseMaps"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `oWtkZW5zZVNldE1hcKJheIBheYJhYWFi`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -1541,7 +1585,10 @@ it("RpcV2CborMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1585,7 +1632,10 @@ it("RpcV2CborDeserializesZeroValuesInMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1627,7 +1677,10 @@ it("RpcV2CborDeserializesDenseSetMap:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1670,7 +1723,10 @@ it.skip("RpcV2CborDeserializesDenseSetMapAndSkipsNull:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1720,16 +1776,16 @@ it("RpcV2CborLists:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborLists"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v2pzdHJpbmdMaXN0gmNmb29jYmFyaXN0cmluZ1NldIJjZm9vY2JhcmtpbnRlZ2VyTGlzdIIBAmtib29sZWFuTGlzdIL19G10aW1lc3RhbXBMaXN0gsH7QdTX+/OAAADB+0HU1/vzgAAAaGVudW1MaXN0gmNGb29hMGtpbnRFbnVtTGlzdIIBAnBuZXN0ZWRTdHJpbmdMaXN0goJjZm9vY2JhcoJjYmF6Y3F1eG1zdHJ1Y3R1cmVMaXN0gqJhYWExYWJhMqJhYWEzYWJhNGhibG9iTGlzdIJDZm9vQ2Jhcv8=`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -1760,16 +1816,16 @@ it("RpcV2CborListsEmpty:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborLists"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v2pzdHJpbmdMaXN0n///`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -1800,16 +1856,16 @@ it("RpcV2CborListsEmptyUsingDefiniteLength:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborLists"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `oWpzdHJpbmdMaXN0gA==`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -1871,7 +1927,10 @@ it("RpcV2CborLists:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1910,7 +1969,10 @@ it("RpcV2CborListsEmpty:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1953,7 +2015,10 @@ it("RpcV2CborIndefiniteStringInsideIndefiniteListCanDeserialize:Response", async }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1996,7 +2061,10 @@ it("RpcV2CborIndefiniteStringInsideDefiniteListCanDeserialize:Response", async ( }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2032,16 +2100,16 @@ it("RpcV2CborSparseMaps:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v29zcGFyc2VTdHJ1Y3RNYXC/Y2Zvb79iaGlldGhlcmX/Y2Jher9iaGljYnll////`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -2083,16 +2151,16 @@ it("RpcV2CborSerializesNullMapValues:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v3BzcGFyc2VCb29sZWFuTWFwv2F49v9vc3BhcnNlTnVtYmVyTWFwv2F49v9vc3BhcnNlU3RyaW5nTWFwv2F49v9vc3BhcnNlU3RydWN0TWFwv2F49v//`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -2126,16 +2194,16 @@ it("RpcV2CborSerializesSparseSetMap:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL///8=`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -2170,16 +2238,16 @@ it("RpcV2CborSerializesSparseSetMapAndRetainsNull:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v2xzcGFyc2VTZXRNYXC/YXif/2F5n2FhYWL/YXr2//8=`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -2215,16 +2283,16 @@ it("RpcV2CborSerializesZeroValuesInSparseMaps:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/RpcV2CborSparseMaps"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v29zcGFyc2VOdW1iZXJNYXC/YXgA/3BzcGFyc2VCb29sZWFuTWFwv2F49P//`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -2272,7 +2340,10 @@ it("RpcV2CborSparseJsonMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2322,7 +2393,10 @@ it("RpcV2CborDeserializesNullMapValues:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2364,7 +2438,10 @@ it("RpcV2CborDeserializesSparseSetMap:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2407,7 +2484,10 @@ it("RpcV2CborDeserializesSparseSetMapAndRetainsNull:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2451,7 +2531,10 @@ it("RpcV2CborDeserializesZeroValuesInSparseMaps:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2489,16 +2572,16 @@ it("RpcV2CborSimpleScalarProperties:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/SimpleScalarProperties"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v2lieXRlVmFsdWUFa2RvdWJsZVZhbHVl+z/+OVgQYk3TcWZhbHNlQm9vbGVhblZhbHVl9GpmbG9hdFZhbHVl+kD0AABsaW50ZWdlclZhbHVlGQEAaWxvbmdWYWx1ZRkmkWpzaG9ydFZhbHVlGSaqa3N0cmluZ1ZhbHVlZnNpbXBsZXB0cnVlQm9vbGVhblZhbHVl9WlibG9iVmFsdWVDZm9v/w==`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -2529,16 +2612,16 @@ it("RpcV2CborClientDoesntSerializeNullStructureValues:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/SimpleScalarProperties"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v/8=`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -2570,16 +2653,16 @@ it("RpcV2CborSupportsNaNFloatInputs:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/SimpleScalarProperties"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v2tkb3VibGVWYWx1Zft/+AAAAAAAAGpmbG9hdFZhbHVl+n/AAAD/`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -2611,16 +2694,16 @@ it("RpcV2CborSupportsInfinityFloatInputs:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/SimpleScalarProperties"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v2tkb3VibGVWYWx1Zft/8AAAAAAAAGpmbG9hdFZhbHVl+n+AAAD/`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -2652,16 +2735,16 @@ it("RpcV2CborSupportsNegativeInfinityFloatInputs:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/SimpleScalarProperties"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v2tkb3VibGVWYWx1Zfv/8AAAAAAAAGpmbG9hdFZhbHVl+v+AAAD/`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -2710,7 +2793,10 @@ it("RpcV2CborSimpleScalarProperties:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2757,7 +2843,10 @@ it("RpcV2CborSimpleScalarPropertiesUsingDefiniteLength:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2827,7 +2916,10 @@ it("RpcV2CborSupportsNaNFloatOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2867,7 +2959,10 @@ it("RpcV2CborSupportsInfinityFloatOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2907,7 +3002,10 @@ it("RpcV2CborSupportsNegativeInfinityFloatOutputs:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2950,7 +3048,10 @@ it("RpcV2CborSupportsUpcastingDataOnDeserialize:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3000,7 +3101,10 @@ it("RpcV2CborExtraFieldsInTheBodyShouldBeSkippedByClients:Response", async () => }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3031,16 +3135,16 @@ it("RpcV2CborSparseMapsSerializeNullValues:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/SparseNullsOperation"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v29zcGFyc2VTdHJpbmdNYXC/Y2Zvb/b//w==`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -3071,16 +3175,16 @@ it("RpcV2CborSparseListsSerializeNull:Request", async () => { const r = err.request; expect(r.method).toBe("POST"); expect(r.path).toBe("/service/RpcV2Protocol/operation/SparseNullsOperation"); - expect(r.headers["content-length"]).toBeDefined(); + expect( + r.headers["content-length"], + `Header key "content-length" should have been defined in ${JSON.stringify(r.headers)}` + ).toBeDefined(); - expect(r.headers["accept"]).toBeDefined(); expect(r.headers["accept"]).toBe("application/cbor"); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/cbor"); - expect(r.headers["smithy-protocol"]).toBeDefined(); expect(r.headers["smithy-protocol"]).toBe("rpc-v2-cbor"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const bodyString = `v3BzcGFyc2VTdHJpbmdMaXN0n/b//w==`; const unequalParts: any = compareEquivalentCborBodies(bodyString, r.body); expect(unequalParts).toBeUndefined(); @@ -3123,7 +3227,10 @@ it("RpcV2CborSparseMapsDeserializeNullValues:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3162,7 +3269,10 @@ it("RpcV2CborSparseListsDeserializeNull:Response", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor/vite.config.js b/private/aws-protocoltests-smithy-rpcv2-cbor/vite.config.js new file mode 100644 index 000000000000..e7147d3ac9e1 --- /dev/null +++ b/private/aws-protocoltests-smithy-rpcv2-cbor/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-restjson-server/package.json b/private/aws-restjson-server/package.json index e4944360e11c..dad3591b0215 100644 --- a/private/aws-restjson-server/package.json +++ b/private/aws-restjson-server/package.json @@ -50,7 +50,8 @@ "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "vitest": "2.1.8" }, "engines": { "node": ">=18.0.0" diff --git a/private/aws-restjson-server/test/functional/restjson1.spec.ts b/private/aws-restjson-server/test/functional/restjson1.spec.ts index dbcd43f43c73..34e89ca2b704 100644 --- a/private/aws-restjson-server/test/functional/restjson1.spec.ts +++ b/private/aws-restjson-server/test/functional/restjson1.spec.ts @@ -12,6 +12,7 @@ import { Encoder as __Encoder } from "@smithy/types"; import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; import { toUtf8 as __utf8Encoder } from "@smithy/util-utf8"; import { Readable } from "stream"; +import { expect, test as it } from "vitest"; import { ComplexError, InvalidGreeting } from "../../src/models/models_0"; import { serializeFrameworkException } from "../../src/protocols/Aws_restJson1"; @@ -543,7 +544,10 @@ it("RestJsonAllQueryStringTypes:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -591,7 +595,10 @@ it("RestJsonQueryStringMap:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -638,7 +645,10 @@ it("RestJsonQueryStringEscaping:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -688,7 +698,10 @@ it("RestJsonSupportsNaNFloatQueryValues:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -738,7 +751,10 @@ it("RestJsonSupportsInfinityFloatQueryValues:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -788,7 +804,10 @@ it("RestJsonSupportsNegativeInfinityFloatQueryValues:ServerRequest", async () => }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -838,7 +857,10 @@ it("RestJsonZeroAndFalseQueryValues:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -883,7 +905,10 @@ it("RestJsonConstantAndVariableQueryStringMissingOneValue:ServerRequest", async }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -930,7 +955,10 @@ it("RestJsonConstantAndVariableQueryStringAllValues:ServerRequest", async () => }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -975,7 +1003,10 @@ it("RestJsonConstantQueryString:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1019,7 +1050,10 @@ it.skip("RestJsonMustSupportParametersInContentType:ServerRequest", async () => }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1066,7 +1100,10 @@ it("DocumentTypeInputWithObject:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1111,7 +1148,10 @@ it("DocumentInputWithString:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1156,7 +1196,10 @@ it("DocumentInputWithNumber:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1201,7 +1244,10 @@ it("DocumentInputWithBoolean:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1257,7 +1303,10 @@ it("DocumentInputWithList:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1311,10 +1360,9 @@ it("DocumentOutput:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"stringValue\": \"string\", @@ -1373,10 +1421,9 @@ it("DocumentOutputString:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"stringValue\": \"string\", @@ -1433,10 +1480,9 @@ it("DocumentOutputNumber:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"stringValue\": \"string\", @@ -1493,10 +1539,9 @@ it("DocumentOutputBoolean:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"stringValue\": \"string\", @@ -1553,10 +1598,9 @@ it("DocumentOutputArray:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"stringValue\": \"string\", @@ -1617,7 +1661,10 @@ it("DocumentTypeAsMapValueInput:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1675,10 +1722,9 @@ it("DocumentTypeAsMapValueOutput:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"docValuedMap\": { @@ -1732,7 +1778,10 @@ it("DocumentTypeAsPayloadInput:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1776,7 +1825,10 @@ it("DocumentTypeAsPayloadInputString:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -1829,10 +1881,9 @@ it("DocumentTypeAsPayloadOutput:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"foo\": \"bar\" @@ -1887,10 +1938,9 @@ it("DocumentTypeAsPayloadOutputString:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `\"hello\"`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2012,10 +2062,9 @@ it("RestJsonEmptyInputAndEmptyOutput:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2094,7 +2143,10 @@ it("RestJsonEndpointTraitWithHostLabel:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2149,10 +2201,9 @@ it("RestJsonGreetingWithErrors:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-greeting"]).toBeDefined(); expect(r.headers["x-greeting"]).toBe("Hello"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2215,14 +2266,11 @@ it("RestJsonComplexErrorWithNoMessage:ServerErrorResponse", async () => { expect(r.statusCode).toBe(403); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ComplexError"); - expect(r.headers["x-header"]).toBeDefined(); expect(r.headers["x-header"]).toBe("Header"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"TopLevel\": \"Top level\", @@ -2281,12 +2329,10 @@ it("RestJsonEmptyComplexErrorWithNoMessage:ServerErrorResponse", async () => { expect(r.statusCode).toBe(403); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ComplexError"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -2345,12 +2391,10 @@ it("RestJsonInvalidGreetingError:ServerErrorResponse", async () => { expect(r.statusCode).toBe(400); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("InvalidGreeting"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"Message\": \"Hi\" @@ -2399,7 +2443,10 @@ it("RestJsonHttpChecksumRequired:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2440,7 +2487,10 @@ it("RestJsonEnumPayloadRequest:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2488,10 +2538,9 @@ it("RestJsonEnumPayloadResponse:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("text/plain"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `enumvalue`; const unequalParts: any = compareEquivalentUnknownTypeBodies(utf8Encoder, bodyString, r.body); @@ -2539,7 +2588,10 @@ it("RestJsonHttpPayloadTraitsWithBlob:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2583,7 +2635,10 @@ it("RestJsonHttpPayloadTraitsWithNoBlobBody:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2630,7 +2685,10 @@ it("RestJsonHttpPayloadTraitsWithBlobAcceptsAllContentTypes:ServerRequest", asyn }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2676,7 +2734,10 @@ it("RestJsonHttpPayloadTraitsWithBlobAcceptsNoContentType:ServerRequest", async }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2723,7 +2784,10 @@ it("RestJsonHttpPayloadTraitsWithBlobAcceptsAllAccepts:ServerRequest", async () }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2775,10 +2839,9 @@ it("RestJsonHttpPayloadTraitsWithBlob:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `blobby blob blob`; const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); @@ -2831,7 +2894,6 @@ it("RestJsonHttpPayloadTraitsWithNoBlobBody:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -2878,7 +2940,10 @@ it("RestJsonHttpPayloadTraitsWithMediaTypeWithBlob:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -2930,12 +2995,10 @@ it("RestJsonHttpPayloadTraitsWithMediaTypeWithBlob:ServerResponse", async () => expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("text/plain"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `blobby blob blob`; const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); @@ -2984,7 +3047,10 @@ it("RestJsonHttpPayloadWithStructure:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3038,10 +3104,9 @@ it("RestJsonHttpPayloadWithStructure:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"greeting\": \"hello\", @@ -3092,7 +3157,10 @@ it("RestJsonHttpPayloadWithUnion:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3177,10 +3245,9 @@ it("RestJsonHttpPayloadWithUnion:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"greeting\": \"hello\" @@ -3233,7 +3300,6 @@ it.skip("RestJsonHttpPayloadWithUnsetUnion:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-length"]).toBeDefined(); expect(r.headers["content-length"]).toBe("0"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -3284,7 +3350,10 @@ it("RestJsonHttpPrefixHeadersArePresent:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3339,11 +3408,8 @@ it("RestJsonHttpPrefixHeadersArePresent:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.headers["x-foo-abc"]).toBeDefined(); expect(r.headers["x-foo-abc"]).toBe("Abc value"); - expect(r.headers["x-foo-def"]).toBeDefined(); expect(r.headers["x-foo-def"]).toBe("Def value"); }); @@ -3396,9 +3462,7 @@ it("HttpPrefixHeadersResponse:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["hello"]).toBeDefined(); expect(r.headers["hello"]).toBe("Hello"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); }); @@ -3440,7 +3504,10 @@ it("RestJsonSupportsNaNFloatLabels:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3483,7 +3550,10 @@ it("RestJsonSupportsInfinityFloatLabels:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3526,7 +3596,10 @@ it("RestJsonSupportsNegativeInfinityFloatLabels:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3569,7 +3642,10 @@ it("RestJsonHttpRequestWithGreedyLabelInPath:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3618,7 +3694,10 @@ it("RestJsonInputWithHeadersAndAllParams:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3667,7 +3746,10 @@ it("RestJsonHttpRequestLabelEscaping:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3715,7 +3797,10 @@ it("RestJsonHttpRequestWithLabelsAndTimestampFormat:ServerRequest", async () => }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3757,7 +3842,10 @@ it("RestJsonToleratesRegexCharsInSegments:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3812,10 +3900,9 @@ it("RestJsonHttpResponseCode:ServerResponse", async () => { expect(r.statusCode).toBe(201); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -3869,10 +3956,9 @@ it("RestJsonHttpResponseCodeDefaultsToModeledCode:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -3915,7 +4001,10 @@ it("RestJsonStringPayloadRequest:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -3963,10 +4052,9 @@ it("RestJsonStringPayloadResponse:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("text/plain"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `rawstring`; const unequalParts: any = compareEquivalentTextBodies(bodyString, r.body); @@ -4005,7 +4093,6 @@ it.skip("RestJsonStringPayloadNoContentType:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(415); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("UnsupportedMediaTypeException"); }); @@ -4043,7 +4130,6 @@ it("RestJsonStringPayloadWrongContentType:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(415); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("UnsupportedMediaTypeException"); }); @@ -4082,7 +4168,6 @@ it("RestJsonStringPayloadUnsatisfiableAccept:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(406); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("NotAcceptableException"); }); @@ -4133,10 +4218,9 @@ it("RestJsonIgnoreQueryParamsInResponse:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -4186,7 +4270,10 @@ it("RestJsonInputAndOutputWithStringHeaders:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4230,7 +4317,10 @@ it("RestJsonInputAndOutputWithQuotedStringHeaders:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4286,7 +4376,10 @@ it("RestJsonInputAndOutputWithNumericHeaders:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4334,7 +4427,10 @@ it("RestJsonInputAndOutputWithBooleanHeaders:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4378,7 +4474,10 @@ it("RestJsonInputAndOutputWithTimestampHeaders:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4424,7 +4523,10 @@ it("RestJsonInputAndOutputWithEnumHeaders:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4470,7 +4572,10 @@ it("RestJsonInputAndOutputWithIntEnumHeaders:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4516,7 +4621,10 @@ it("RestJsonSupportsNaNFloatHeaderInputs:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4562,7 +4670,10 @@ it("RestJsonSupportsInfinityFloatHeaderInputs:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4608,7 +4719,10 @@ it("RestJsonSupportsNegativeInfinityFloatHeaderInputs:ServerRequest", async () = }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4661,11 +4775,8 @@ it("RestJsonInputAndOutputWithStringHeaders:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-string"]).toBeDefined(); expect(r.headers["x-string"]).toBe("Hello"); - expect(r.headers["x-stringlist"]).toBeDefined(); expect(r.headers["x-stringlist"]).toBe("a, b, c"); - expect(r.headers["x-stringset"]).toBeDefined(); expect(r.headers["x-stringset"]).toBe("a, b, c"); }); @@ -4715,7 +4826,6 @@ it("RestJsonInputAndOutputWithQuotedStringHeaders:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-stringlist"]).toBeDefined(); expect(r.headers["x-stringlist"]).toBe('"b,c", "\\"def\\"", a'); }); @@ -4771,19 +4881,12 @@ it("RestJsonInputAndOutputWithNumericHeaders:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-byte"]).toBeDefined(); expect(r.headers["x-byte"]).toBe("1"); - expect(r.headers["x-double"]).toBeDefined(); expect(r.headers["x-double"]).toBe("1.1"); - expect(r.headers["x-float"]).toBeDefined(); expect(r.headers["x-float"]).toBe("1.1"); - expect(r.headers["x-integer"]).toBeDefined(); expect(r.headers["x-integer"]).toBe("123"); - expect(r.headers["x-integerlist"]).toBeDefined(); expect(r.headers["x-integerlist"]).toBe("1, 2, 3"); - expect(r.headers["x-long"]).toBeDefined(); expect(r.headers["x-long"]).toBe("123"); - expect(r.headers["x-short"]).toBeDefined(); expect(r.headers["x-short"]).toBe("123"); }); @@ -4835,11 +4938,8 @@ it("RestJsonInputAndOutputWithBooleanHeaders:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-boolean1"]).toBeDefined(); expect(r.headers["x-boolean1"]).toBe("true"); - expect(r.headers["x-boolean2"]).toBeDefined(); expect(r.headers["x-boolean2"]).toBe("false"); - expect(r.headers["x-booleanlist"]).toBeDefined(); expect(r.headers["x-booleanlist"]).toBe("true, false, true"); }); @@ -4889,7 +4989,6 @@ it("RestJsonInputAndOutputWithTimestampHeaders:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-timestamplist"]).toBeDefined(); expect(r.headers["x-timestamplist"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT"); }); @@ -4940,9 +5039,7 @@ it("RestJsonInputAndOutputWithEnumHeaders:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-enum"]).toBeDefined(); expect(r.headers["x-enum"]).toBe("Foo"); - expect(r.headers["x-enumlist"]).toBeDefined(); expect(r.headers["x-enumlist"]).toBe("Foo, Bar, Baz"); }); @@ -4993,9 +5090,7 @@ it("RestJsonInputAndOutputWithIntEnumHeaders:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-integerenum"]).toBeDefined(); expect(r.headers["x-integerenum"]).toBe("1"); - expect(r.headers["x-integerenumlist"]).toBeDefined(); expect(r.headers["x-integerenumlist"]).toBe("1, 2, 3"); }); @@ -5046,9 +5141,7 @@ it("RestJsonSupportsNaNFloatHeaderOutputs:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-double"]).toBeDefined(); expect(r.headers["x-double"]).toBe("NaN"); - expect(r.headers["x-float"]).toBeDefined(); expect(r.headers["x-float"]).toBe("NaN"); }); @@ -5099,9 +5192,7 @@ it("RestJsonSupportsInfinityFloatHeaderOutputs:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-double"]).toBeDefined(); expect(r.headers["x-double"]).toBe("Infinity"); - expect(r.headers["x-float"]).toBeDefined(); expect(r.headers["x-float"]).toBe("Infinity"); }); @@ -5152,9 +5243,7 @@ it("RestJsonSupportsNegativeInfinityFloatHeaderOutputs:ServerResponse", async () expect(r.statusCode).toBe(200); - expect(r.headers["x-double"]).toBeDefined(); expect(r.headers["x-double"]).toBe("-Infinity"); - expect(r.headers["x-float"]).toBeDefined(); expect(r.headers["x-float"]).toBe("-Infinity"); }); @@ -5197,7 +5286,10 @@ it("RestJsonJsonBlobs:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5248,10 +5340,9 @@ it("RestJsonJsonBlobs:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"data\": \"dmFsdWU=\" @@ -5309,7 +5400,10 @@ it("RestJsonJsonEnums:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5368,10 +5462,9 @@ it("RestJsonJsonEnums:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"fooEnum1\": \"Foo\", @@ -5443,7 +5536,10 @@ it("RestJsonJsonIntEnums:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5502,10 +5598,9 @@ it("RestJsonJsonIntEnums:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"integerEnum1\": 1, @@ -5590,7 +5685,10 @@ it("RestJsonLists:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5634,7 +5732,10 @@ it("RestJsonListsEmpty:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5705,10 +5806,9 @@ it("RestJsonLists:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"stringList\": [ @@ -5810,10 +5910,9 @@ it("RestJsonListsEmpty:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"stringList\": [] @@ -5870,7 +5969,10 @@ it("RestJsonJsonMaps:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5921,7 +6023,10 @@ it("RestJsonSerializesZeroValuesInMaps:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -5968,7 +6073,10 @@ it("RestJsonSerializesDenseSetMap:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6026,10 +6134,9 @@ it("RestJsonJsonMaps:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"denseStructMap\": { @@ -6096,10 +6203,9 @@ it("RestJsonDeserializesZeroValuesInMaps:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"denseNumberMap\": { @@ -6162,10 +6268,9 @@ it("RestJsonDeserializesDenseSetMap:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"denseSetMap\": { @@ -6216,7 +6321,10 @@ it("RestJsonJsonTimestamps:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6260,7 +6368,10 @@ it("RestJsonJsonTimestampsWithDateTimeFormat:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6304,7 +6415,10 @@ it("RestJsonJsonTimestampsWithDateTimeOnTargetFormat:ServerRequest", async () => }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6348,7 +6462,10 @@ it("RestJsonJsonTimestampsWithEpochSecondsFormat:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6392,7 +6509,10 @@ it("RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat:ServerRequest", async ( }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6436,7 +6556,10 @@ it("RestJsonJsonTimestampsWithHttpDateFormat:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6480,7 +6603,10 @@ it("RestJsonJsonTimestampsWithHttpDateOnTargetFormat:ServerRequest", async () => }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6531,10 +6657,9 @@ it("RestJsonJsonTimestamps:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"normal\": 1398796238 @@ -6589,10 +6714,9 @@ it("RestJsonJsonTimestampsWithDateTimeFormat:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"dateTime\": \"2014-04-29T18:30:38Z\" @@ -6647,10 +6771,9 @@ it("RestJsonJsonTimestampsWithDateTimeOnTargetFormat:ServerResponse", async () = expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"dateTimeOnTarget\": \"2014-04-29T18:30:38Z\" @@ -6705,10 +6828,9 @@ it("RestJsonJsonTimestampsWithEpochSecondsFormat:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"epochSeconds\": 1398796238 @@ -6763,10 +6885,9 @@ it("RestJsonJsonTimestampsWithEpochSecondsOnTargetFormat:ServerResponse", async expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"epochSecondsOnTarget\": 1398796238 @@ -6821,10 +6942,9 @@ it("RestJsonJsonTimestampsWithHttpDateFormat:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"httpDate\": \"Tue, 29 Apr 2014 18:30:38 GMT\" @@ -6879,10 +6999,9 @@ it("RestJsonJsonTimestampsWithHttpDateOnTargetFormat:ServerResponse", async () = expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"httpDateOnTarget\": \"Tue, 29 Apr 2014 18:30:38 GMT\" @@ -6932,7 +7051,10 @@ it("RestJsonSerializeStringUnionValue:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -6978,7 +7100,10 @@ it("RestJsonSerializeBooleanUnionValue:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7024,7 +7149,10 @@ it("RestJsonSerializeNumberUnionValue:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7070,7 +7198,10 @@ it("RestJsonSerializeBlobUnionValue:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7116,7 +7247,10 @@ it("RestJsonSerializeTimestampUnionValue:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7162,7 +7296,10 @@ it("RestJsonSerializeEnumUnionValue:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7208,7 +7345,10 @@ it("RestJsonSerializeListUnionValue:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7259,7 +7399,10 @@ it("RestJsonSerializeMapUnionValue:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7309,7 +7452,10 @@ it("RestJsonSerializeStructureUnionValue:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7359,7 +7505,10 @@ it("RestJsonSerializeRenamedStructureUnionValue:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -7412,10 +7561,9 @@ it("RestJsonDeserializeStringUnionValue:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"contents\": { @@ -7474,10 +7622,9 @@ it("RestJsonDeserializeBooleanUnionValue:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"contents\": { @@ -7536,10 +7683,9 @@ it("RestJsonDeserializeNumberUnionValue:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"contents\": { @@ -7598,10 +7744,9 @@ it("RestJsonDeserializeBlobUnionValue:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"contents\": { @@ -7660,10 +7805,9 @@ it("RestJsonDeserializeTimestampUnionValue:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"contents\": { @@ -7722,10 +7866,9 @@ it("RestJsonDeserializeEnumUnionValue:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"contents\": { @@ -7784,10 +7927,9 @@ it("RestJsonDeserializeListUnionValue:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"contents\": { @@ -7849,10 +7991,9 @@ it("RestJsonDeserializeMapUnionValue:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"contents\": { @@ -7916,10 +8057,9 @@ it("RestJsonDeserializeStructureUnionValue:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"contents\": { @@ -7965,7 +8105,6 @@ it("RestJsonWithBodyExpectsApplicationJsonAccept:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(406); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("NotAcceptableException"); }); @@ -8003,7 +8142,6 @@ it("RestJsonWithPayloadExpectsImpliedAccept:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(406); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("NotAcceptableException"); }); @@ -8040,7 +8178,6 @@ it("RestJsonWithPayloadExpectsModeledAccept:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(406); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("NotAcceptableException"); }); @@ -8079,7 +8216,6 @@ it("RestJsonBodyMalformedBlobInvalidBase64_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8118,7 +8254,6 @@ it("RestJsonBodyMalformedBlobInvalidBase64_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8157,7 +8292,6 @@ it("RestJsonBodyMalformedBlobInvalidBase64_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8196,7 +8330,6 @@ it("RestJsonBodyMalformedBlobInvalidBase64_case3:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8235,7 +8368,6 @@ it("RestJsonBodyMalformedBlobInvalidBase64_case4:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8274,7 +8406,6 @@ it("RestJsonBodyMalformedBlobInvalidBase64_case5:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8313,7 +8444,6 @@ it("RestJsonBodyMalformedBlobInvalidBase64_case6:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8352,7 +8482,6 @@ it("RestJsonBodyMalformedBlobInvalidBase64_case7:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8391,7 +8520,6 @@ it("RestJsonBodyMalformedBlobInvalidBase64_case8:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8429,7 +8557,6 @@ it.skip("RestJsonBodyBooleanStringCoercion_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8467,7 +8594,6 @@ it.skip("RestJsonBodyBooleanStringCoercion_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8505,7 +8631,6 @@ it.skip("RestJsonBodyBooleanStringCoercion_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8543,7 +8668,6 @@ it("RestJsonBodyBooleanStringCoercion_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8581,7 +8705,6 @@ it("RestJsonBodyBooleanStringCoercion_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8619,7 +8742,6 @@ it("RestJsonBodyBooleanStringCoercion_case5:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8657,7 +8779,6 @@ it("RestJsonBodyBooleanStringCoercion_case6:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8695,7 +8816,6 @@ it("RestJsonBodyBooleanStringCoercion_case7:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8733,7 +8853,6 @@ it("RestJsonBodyBooleanStringCoercion_case8:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8771,7 +8890,6 @@ it("RestJsonBodyBooleanStringCoercion_case9:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8809,7 +8927,6 @@ it("RestJsonBodyBooleanStringCoercion_case10:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8847,7 +8964,6 @@ it("RestJsonBodyBooleanStringCoercion_case11:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8885,7 +9001,6 @@ it.skip("RestJsonBodyBooleanStringCoercion_case12:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8923,7 +9038,6 @@ it.skip("RestJsonBodyBooleanStringCoercion_case13:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8961,7 +9075,6 @@ it.skip("RestJsonBodyBooleanStringCoercion_case14:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -8999,7 +9112,6 @@ it("RestJsonBodyBooleanStringCoercion_case15:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9037,7 +9149,6 @@ it("RestJsonBodyBooleanStringCoercion_case16:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9075,7 +9186,6 @@ it("RestJsonBodyBooleanStringCoercion_case17:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9113,7 +9223,6 @@ it("RestJsonBodyBooleanStringCoercion_case18:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9151,7 +9260,6 @@ it("RestJsonBodyBooleanStringCoercion_case19:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9189,7 +9297,6 @@ it("RestJsonBodyBooleanStringCoercion_case20:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9227,7 +9334,6 @@ it("RestJsonBodyBooleanStringCoercion_case21:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9265,7 +9371,6 @@ it("RestJsonBodyBooleanStringCoercion_case22:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9303,7 +9408,6 @@ it("RestJsonBodyBooleanStringCoercion_case23:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9341,7 +9445,6 @@ it("RestJsonBodyBooleanBadLiteral_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9379,7 +9482,6 @@ it("RestJsonBodyBooleanBadLiteral_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9417,7 +9519,6 @@ it("RestJsonBodyBooleanBadLiteral_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9455,7 +9556,6 @@ it("RestJsonBodyBooleanBadLiteral_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9493,7 +9593,6 @@ it("RestJsonBodyBooleanBadLiteral_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9531,7 +9630,6 @@ it("RestJsonBodyBooleanBadLiteral_case5:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9569,7 +9667,6 @@ it("RestJsonBodyBooleanBadLiteral_case6:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9607,7 +9704,6 @@ it.skip("RestJsonBodyBooleanBadLiteral_case7:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9645,7 +9741,6 @@ it("RestJsonBodyBooleanBadLiteral_case8:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9683,7 +9778,6 @@ it("RestJsonBodyBooleanBadLiteral_case9:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9721,7 +9815,6 @@ it("RestJsonBodyBooleanBadLiteral_case10:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9759,7 +9852,6 @@ it("RestJsonBodyBooleanBadLiteral_case11:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9797,7 +9889,6 @@ it("RestJsonBodyBooleanBadLiteral_case12:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9835,7 +9926,6 @@ it("RestJsonBodyBooleanBadLiteral_case13:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9873,7 +9963,6 @@ it("RestJsonBodyBooleanBadLiteral_case14:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9911,7 +10000,6 @@ it("RestJsonBodyBooleanBadLiteral_case15:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9949,7 +10037,6 @@ it("RestJsonBodyBooleanBadLiteral_case16:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -9987,7 +10074,6 @@ it("RestJsonBodyBooleanBadLiteral_case17:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10025,7 +10111,6 @@ it.skip("RestJsonBodyBooleanBadLiteral_case18:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10063,7 +10148,6 @@ it("RestJsonBodyBooleanBadLiteral_case19:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10101,7 +10185,6 @@ it("RestJsonBodyBooleanBadLiteral_case20:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10139,7 +10222,6 @@ it("RestJsonBodyBooleanBadLiteral_case21:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10174,7 +10256,6 @@ it("RestJsonPathBooleanStringCoercion_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10209,7 +10290,6 @@ it("RestJsonPathBooleanStringCoercion_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10244,7 +10324,6 @@ it("RestJsonPathBooleanStringCoercion_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10279,7 +10358,6 @@ it("RestJsonPathBooleanStringCoercion_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10314,7 +10392,6 @@ it("RestJsonPathBooleanStringCoercion_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10349,7 +10426,6 @@ it("RestJsonPathBooleanStringCoercion_case5:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10384,7 +10460,6 @@ it("RestJsonPathBooleanStringCoercion_case6:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10419,7 +10494,6 @@ it("RestJsonPathBooleanStringCoercion_case7:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10454,7 +10528,6 @@ it("RestJsonPathBooleanStringCoercion_case8:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10489,7 +10562,6 @@ it("RestJsonPathBooleanStringCoercion_case9:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10524,7 +10596,6 @@ it("RestJsonPathBooleanStringCoercion_case10:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10559,7 +10630,6 @@ it("RestJsonPathBooleanStringCoercion_case11:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10594,7 +10664,6 @@ it("RestJsonPathBooleanStringCoercion_case12:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10629,7 +10698,6 @@ it("RestJsonPathBooleanStringCoercion_case13:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10664,7 +10732,6 @@ it("RestJsonPathBooleanStringCoercion_case14:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10699,7 +10766,6 @@ it("RestJsonPathBooleanStringCoercion_case15:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10734,7 +10800,6 @@ it("RestJsonPathBooleanStringCoercion_case16:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10769,7 +10834,6 @@ it("RestJsonPathBooleanStringCoercion_case17:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10804,7 +10868,6 @@ it("RestJsonPathBooleanStringCoercion_case18:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10839,7 +10902,6 @@ it("RestJsonPathBooleanStringCoercion_case19:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10874,7 +10936,6 @@ it("RestJsonPathBooleanStringCoercion_case20:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10909,7 +10970,6 @@ it("RestJsonPathBooleanStringCoercion_case21:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10946,7 +11006,6 @@ it("RestJsonQueryBooleanStringCoercion_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -10983,7 +11042,6 @@ it("RestJsonQueryBooleanStringCoercion_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11020,7 +11078,6 @@ it("RestJsonQueryBooleanStringCoercion_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11057,7 +11114,6 @@ it("RestJsonQueryBooleanStringCoercion_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11094,7 +11150,6 @@ it("RestJsonQueryBooleanStringCoercion_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11131,7 +11186,6 @@ it("RestJsonQueryBooleanStringCoercion_case5:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11168,7 +11222,6 @@ it("RestJsonQueryBooleanStringCoercion_case6:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11205,7 +11258,6 @@ it("RestJsonQueryBooleanStringCoercion_case7:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11242,7 +11294,6 @@ it("RestJsonQueryBooleanStringCoercion_case8:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11279,7 +11330,6 @@ it("RestJsonQueryBooleanStringCoercion_case9:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11316,7 +11366,6 @@ it("RestJsonQueryBooleanStringCoercion_case10:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11353,7 +11402,6 @@ it("RestJsonQueryBooleanStringCoercion_case11:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11390,7 +11438,6 @@ it("RestJsonQueryBooleanStringCoercion_case12:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11427,7 +11474,6 @@ it("RestJsonQueryBooleanStringCoercion_case13:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11464,7 +11510,6 @@ it("RestJsonQueryBooleanStringCoercion_case14:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11501,7 +11546,6 @@ it("RestJsonQueryBooleanStringCoercion_case15:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11538,7 +11582,6 @@ it("RestJsonQueryBooleanStringCoercion_case16:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11575,7 +11618,6 @@ it("RestJsonQueryBooleanStringCoercion_case17:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11612,7 +11654,6 @@ it("RestJsonQueryBooleanStringCoercion_case18:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11649,7 +11690,6 @@ it("RestJsonQueryBooleanStringCoercion_case19:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11686,7 +11726,6 @@ it("RestJsonQueryBooleanStringCoercion_case20:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11723,7 +11762,6 @@ it("RestJsonQueryBooleanStringCoercion_case21:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11760,7 +11798,6 @@ it("RestJsonHeaderBooleanStringCoercion_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11797,7 +11834,6 @@ it("RestJsonHeaderBooleanStringCoercion_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11834,7 +11870,6 @@ it("RestJsonHeaderBooleanStringCoercion_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11871,7 +11906,6 @@ it("RestJsonHeaderBooleanStringCoercion_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11908,7 +11942,6 @@ it("RestJsonHeaderBooleanStringCoercion_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11945,7 +11978,6 @@ it("RestJsonHeaderBooleanStringCoercion_case5:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -11982,7 +12014,6 @@ it("RestJsonHeaderBooleanStringCoercion_case6:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12019,7 +12050,6 @@ it("RestJsonHeaderBooleanStringCoercion_case7:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12056,7 +12086,6 @@ it("RestJsonHeaderBooleanStringCoercion_case8:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12093,7 +12122,6 @@ it("RestJsonHeaderBooleanStringCoercion_case9:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12130,7 +12158,6 @@ it("RestJsonHeaderBooleanStringCoercion_case10:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12167,7 +12194,6 @@ it("RestJsonHeaderBooleanStringCoercion_case11:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12204,7 +12230,6 @@ it("RestJsonHeaderBooleanStringCoercion_case12:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12241,7 +12266,6 @@ it("RestJsonHeaderBooleanStringCoercion_case13:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12278,7 +12302,6 @@ it("RestJsonHeaderBooleanStringCoercion_case14:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12315,7 +12338,6 @@ it("RestJsonHeaderBooleanStringCoercion_case15:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12352,7 +12374,6 @@ it("RestJsonHeaderBooleanStringCoercion_case16:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12389,7 +12410,6 @@ it("RestJsonHeaderBooleanStringCoercion_case17:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12426,7 +12446,6 @@ it("RestJsonHeaderBooleanStringCoercion_case18:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12463,7 +12482,6 @@ it("RestJsonHeaderBooleanStringCoercion_case19:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12500,7 +12518,6 @@ it("RestJsonHeaderBooleanStringCoercion_case20:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12537,7 +12554,6 @@ it("RestJsonHeaderBooleanStringCoercion_case21:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12575,7 +12591,6 @@ it("RestJsonBodyByteUnderflowOverflow_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12613,7 +12628,6 @@ it("RestJsonBodyByteUnderflowOverflow_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12651,7 +12665,6 @@ it("RestJsonBodyByteUnderflowOverflow_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12689,7 +12702,6 @@ it("RestJsonBodyByteUnderflowOverflow_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12727,7 +12739,6 @@ it("RestJsonBodyByteUnderflowOverflow_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12762,7 +12773,6 @@ it("RestJsonPathByteUnderflowOverflow_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12797,7 +12807,6 @@ it("RestJsonPathByteUnderflowOverflow_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12832,7 +12841,6 @@ it("RestJsonPathByteUnderflowOverflow_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12867,7 +12875,6 @@ it("RestJsonPathByteUnderflowOverflow_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12902,7 +12909,6 @@ it("RestJsonPathByteUnderflowOverflow_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12939,7 +12945,6 @@ it("RestJsonQueryByteUnderflowOverflow_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -12976,7 +12981,6 @@ it("RestJsonQueryByteUnderflowOverflow_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13013,7 +13017,6 @@ it("RestJsonQueryByteUnderflowOverflow_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13050,7 +13053,6 @@ it("RestJsonQueryByteUnderflowOverflow_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13087,7 +13089,6 @@ it("RestJsonQueryByteUnderflowOverflow_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13124,7 +13125,6 @@ it("RestJsonHeaderByteUnderflowOverflow_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13161,7 +13161,6 @@ it("RestJsonHeaderByteUnderflowOverflow_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13198,7 +13197,6 @@ it("RestJsonHeaderByteUnderflowOverflow_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13235,7 +13233,6 @@ it("RestJsonHeaderByteUnderflowOverflow_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13272,7 +13269,6 @@ it("RestJsonHeaderByteUnderflowOverflow_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13310,7 +13306,6 @@ it("RestJsonBodyByteMalformedValueRejected_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13348,7 +13343,6 @@ it("RestJsonBodyByteMalformedValueRejected_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13386,7 +13380,6 @@ it("RestJsonBodyByteMalformedValueRejected_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13424,7 +13417,6 @@ it("RestJsonBodyByteMalformedValueRejected_case3:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13462,7 +13454,6 @@ it("RestJsonBodyByteMalformedValueRejected_case4:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13500,7 +13491,6 @@ it("RestJsonBodyByteMalformedValueRejected_case5:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13538,7 +13528,6 @@ it("RestJsonBodyByteMalformedValueRejected_case6:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13576,7 +13565,6 @@ it("RestJsonBodyByteMalformedValueRejected_case7:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13614,7 +13602,6 @@ it("RestJsonBodyByteMalformedValueRejected_case8:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13652,7 +13639,6 @@ it("RestJsonBodyByteMalformedValueRejected_case9:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13690,7 +13676,6 @@ it("RestJsonBodyByteMalformedValueRejected_case10:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13725,7 +13710,6 @@ it("RestJsonPathByteMalformedValueRejected_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13760,7 +13744,6 @@ it("RestJsonPathByteMalformedValueRejected_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13795,7 +13778,6 @@ it("RestJsonPathByteMalformedValueRejected_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13830,7 +13812,6 @@ it("RestJsonPathByteMalformedValueRejected_case3:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13865,7 +13846,6 @@ it("RestJsonPathByteMalformedValueRejected_case4:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13900,7 +13880,6 @@ it("RestJsonPathByteMalformedValueRejected_case5:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13935,7 +13914,6 @@ it("RestJsonPathByteMalformedValueRejected_case6:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -13972,7 +13950,6 @@ it("RestJsonQueryByteMalformedValueRejected_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14009,7 +13986,6 @@ it("RestJsonQueryByteMalformedValueRejected_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14046,7 +14022,6 @@ it("RestJsonQueryByteMalformedValueRejected_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14083,7 +14058,6 @@ it("RestJsonQueryByteMalformedValueRejected_case3:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14120,7 +14094,6 @@ it("RestJsonQueryByteMalformedValueRejected_case4:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14157,7 +14130,6 @@ it("RestJsonQueryByteMalformedValueRejected_case5:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14194,7 +14166,6 @@ it("RestJsonQueryByteMalformedValueRejected_case6:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14231,7 +14202,6 @@ it("RestJsonHeaderByteMalformedValueRejected_case0:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14268,7 +14238,6 @@ it("RestJsonHeaderByteMalformedValueRejected_case1:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14305,7 +14274,6 @@ it("RestJsonHeaderByteMalformedValueRejected_case2:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14342,7 +14310,6 @@ it("RestJsonHeaderByteMalformedValueRejected_case3:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14379,7 +14346,6 @@ it("RestJsonHeaderByteMalformedValueRejected_case4:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14416,7 +14382,6 @@ it("RestJsonHeaderByteMalformedValueRejected_case5:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14453,7 +14418,6 @@ it("RestJsonHeaderByteMalformedValueRejected_case6:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14491,7 +14455,6 @@ it("RestJsonWithBodyExpectsApplicationJsonContentType:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(415); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("UnsupportedMediaTypeException"); }); @@ -14527,7 +14490,6 @@ it.skip("RestJsonWithBodyExpectsApplicationJsonContentTypeNoHeaders:MalformedReq expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(415); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("UnsupportedMediaTypeException"); }); @@ -14565,7 +14527,6 @@ it("RestJsonWithoutBodyExpectsEmptyContentType:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(415); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("UnsupportedMediaTypeException"); }); @@ -14603,7 +14564,6 @@ it.skip("RestJsonWithoutBodyEmptyInputExpectsEmptyContentType:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(415); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("UnsupportedMediaTypeException"); }); @@ -14641,7 +14601,6 @@ it("RestJsonWithPayloadExpectsModeledContentType:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(415); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("UnsupportedMediaTypeException"); }); @@ -14680,7 +14639,6 @@ it("RestJsonWithPayloadExpectsImpliedContentType:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(415); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("UnsupportedMediaTypeException"); }); @@ -14718,7 +14676,6 @@ it("RestJsonBodyDoubleMalformedValueRejected_case0:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14756,7 +14713,6 @@ it("RestJsonBodyDoubleMalformedValueRejected_case1:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14794,7 +14750,6 @@ it("RestJsonBodyDoubleMalformedValueRejected_case2:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14832,7 +14787,6 @@ it("RestJsonBodyDoubleMalformedValueRejected_case3:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14870,7 +14824,6 @@ it("RestJsonBodyDoubleMalformedValueRejected_case4:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14908,7 +14861,6 @@ it("RestJsonBodyDoubleMalformedValueRejected_case5:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14946,7 +14898,6 @@ it("RestJsonBodyDoubleMalformedValueRejected_case6:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -14981,7 +14932,6 @@ it("RestJsonPathDoubleMalformedValueRejected_case0:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15016,7 +14966,6 @@ it("RestJsonPathDoubleMalformedValueRejected_case1:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15051,7 +15000,6 @@ it("RestJsonPathDoubleMalformedValueRejected_case2:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15088,7 +15036,6 @@ it("RestJsonQueryDoubleMalformedValueRejected_case0:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15125,7 +15072,6 @@ it("RestJsonQueryDoubleMalformedValueRejected_case1:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15162,7 +15108,6 @@ it("RestJsonQueryDoubleMalformedValueRejected_case2:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15199,7 +15144,6 @@ it("RestJsonHeaderDoubleMalformedValueRejected_case0:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15236,7 +15180,6 @@ it("RestJsonHeaderDoubleMalformedValueRejected_case1:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15273,7 +15216,6 @@ it("RestJsonHeaderDoubleMalformedValueRejected_case2:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15311,7 +15253,6 @@ it("RestJsonBodyFloatMalformedValueRejected_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15349,7 +15290,6 @@ it("RestJsonBodyFloatMalformedValueRejected_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15387,7 +15327,6 @@ it("RestJsonBodyFloatMalformedValueRejected_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15425,7 +15364,6 @@ it("RestJsonBodyFloatMalformedValueRejected_case3:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15463,7 +15401,6 @@ it("RestJsonBodyFloatMalformedValueRejected_case4:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15501,7 +15438,6 @@ it("RestJsonBodyFloatMalformedValueRejected_case5:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15539,7 +15475,6 @@ it("RestJsonBodyFloatMalformedValueRejected_case6:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15574,7 +15509,6 @@ it("RestJsonPathFloatMalformedValueRejected_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15609,7 +15543,6 @@ it("RestJsonPathFloatMalformedValueRejected_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15644,7 +15577,6 @@ it("RestJsonPathFloatMalformedValueRejected_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15681,7 +15613,6 @@ it("RestJsonQueryFloatMalformedValueRejected_case0:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15718,7 +15649,6 @@ it("RestJsonQueryFloatMalformedValueRejected_case1:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15755,7 +15685,6 @@ it("RestJsonQueryFloatMalformedValueRejected_case2:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15792,7 +15721,6 @@ it("RestJsonHeaderFloatMalformedValueRejected_case0:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15829,7 +15757,6 @@ it("RestJsonHeaderFloatMalformedValueRejected_case1:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15866,7 +15793,6 @@ it("RestJsonHeaderFloatMalformedValueRejected_case2:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15904,7 +15830,6 @@ it("RestJsonBodyIntegerUnderflowOverflow_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15942,7 +15867,6 @@ it("RestJsonBodyIntegerUnderflowOverflow_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -15980,7 +15904,6 @@ it("RestJsonBodyIntegerUnderflowOverflow_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16015,7 +15938,6 @@ it("RestJsonPathIntegerUnderflowOverflow_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16050,7 +15972,6 @@ it("RestJsonPathIntegerUnderflowOverflow_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16085,7 +16006,6 @@ it("RestJsonPathIntegerUnderflowOverflow_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16122,7 +16042,6 @@ it("RestJsonQueryIntegerUnderflowOverflow_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16159,7 +16078,6 @@ it("RestJsonQueryIntegerUnderflowOverflow_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16196,7 +16114,6 @@ it("RestJsonQueryIntegerUnderflowOverflow_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16233,7 +16150,6 @@ it("RestJsonHeaderIntegerUnderflowOverflow_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16270,7 +16186,6 @@ it("RestJsonHeaderIntegerUnderflowOverflow_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16307,7 +16222,6 @@ it("RestJsonHeaderIntegerUnderflowOverflow_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16345,7 +16259,6 @@ it("RestJsonBodyIntegerMalformedValueRejected_case0:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16383,7 +16296,6 @@ it("RestJsonBodyIntegerMalformedValueRejected_case1:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16421,7 +16333,6 @@ it("RestJsonBodyIntegerMalformedValueRejected_case2:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16459,7 +16370,6 @@ it("RestJsonBodyIntegerMalformedValueRejected_case3:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16497,7 +16407,6 @@ it("RestJsonBodyIntegerMalformedValueRejected_case4:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16535,7 +16444,6 @@ it("RestJsonBodyIntegerMalformedValueRejected_case5:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16573,7 +16481,6 @@ it("RestJsonBodyIntegerMalformedValueRejected_case6:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16611,7 +16518,6 @@ it("RestJsonBodyIntegerMalformedValueRejected_case7:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16649,7 +16555,6 @@ it("RestJsonBodyIntegerMalformedValueRejected_case8:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16687,7 +16592,6 @@ it("RestJsonBodyIntegerMalformedValueRejected_case9:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16725,7 +16629,6 @@ it("RestJsonBodyIntegerMalformedValueRejected_case10:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16760,7 +16663,6 @@ it("RestJsonPathIntegerMalformedValueRejected_case0:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16795,7 +16697,6 @@ it("RestJsonPathIntegerMalformedValueRejected_case1:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16830,7 +16731,6 @@ it("RestJsonPathIntegerMalformedValueRejected_case2:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16865,7 +16765,6 @@ it("RestJsonPathIntegerMalformedValueRejected_case3:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16900,7 +16799,6 @@ it("RestJsonPathIntegerMalformedValueRejected_case4:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16935,7 +16833,6 @@ it("RestJsonPathIntegerMalformedValueRejected_case5:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -16970,7 +16867,6 @@ it("RestJsonPathIntegerMalformedValueRejected_case6:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17007,7 +16903,6 @@ it("RestJsonQueryIntegerMalformedValueRejected_case0:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17044,7 +16939,6 @@ it("RestJsonQueryIntegerMalformedValueRejected_case1:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17081,7 +16975,6 @@ it("RestJsonQueryIntegerMalformedValueRejected_case2:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17118,7 +17011,6 @@ it("RestJsonQueryIntegerMalformedValueRejected_case3:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17155,7 +17047,6 @@ it("RestJsonQueryIntegerMalformedValueRejected_case4:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17192,7 +17083,6 @@ it("RestJsonQueryIntegerMalformedValueRejected_case5:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17229,7 +17119,6 @@ it("RestJsonQueryIntegerMalformedValueRejected_case6:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17266,7 +17155,6 @@ it("RestJsonHeaderIntegerMalformedValueRejected_case0:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17303,7 +17191,6 @@ it("RestJsonHeaderIntegerMalformedValueRejected_case1:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17340,7 +17227,6 @@ it("RestJsonHeaderIntegerMalformedValueRejected_case2:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17377,7 +17263,6 @@ it("RestJsonHeaderIntegerMalformedValueRejected_case3:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17414,7 +17299,6 @@ it("RestJsonHeaderIntegerMalformedValueRejected_case4:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17451,7 +17335,6 @@ it("RestJsonHeaderIntegerMalformedValueRejected_case5:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17488,7 +17371,6 @@ it("RestJsonHeaderIntegerMalformedValueRejected_case6:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17527,7 +17409,6 @@ it("RestJsonBodyMalformedListNullItem:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17566,7 +17447,6 @@ it("RestJsonBodyMalformedListUnclosed:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17604,7 +17484,6 @@ it.skip("RestJsonBodyLongUnderflowOverflow_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17642,7 +17521,6 @@ it.skip("RestJsonBodyLongUnderflowOverflow_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17680,7 +17558,6 @@ it.skip("RestJsonBodyLongUnderflowOverflow_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17715,7 +17592,6 @@ it.skip("RestJsonPathLongUnderflowOverflow_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17750,7 +17626,6 @@ it.skip("RestJsonPathLongUnderflowOverflow_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17785,7 +17660,6 @@ it.skip("RestJsonPathLongUnderflowOverflow_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17822,7 +17696,6 @@ it.skip("RestJsonQueryLongUnderflowOverflow_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17859,7 +17732,6 @@ it.skip("RestJsonQueryLongUnderflowOverflow_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17896,7 +17768,6 @@ it.skip("RestJsonQueryLongUnderflowOverflow_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17933,7 +17804,6 @@ it.skip("RestJsonHeaderLongUnderflowOverflow_case0:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -17970,7 +17840,6 @@ it.skip("RestJsonHeaderLongUnderflowOverflow_case1:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18007,7 +17876,6 @@ it.skip("RestJsonHeaderLongUnderflowOverflow_case2:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18045,7 +17913,6 @@ it("RestJsonBodyLongMalformedValueRejected_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18083,7 +17950,6 @@ it("RestJsonBodyLongMalformedValueRejected_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18121,7 +17987,6 @@ it("RestJsonBodyLongMalformedValueRejected_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18159,7 +18024,6 @@ it("RestJsonBodyLongMalformedValueRejected_case3:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18197,7 +18061,6 @@ it("RestJsonBodyLongMalformedValueRejected_case4:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18235,7 +18098,6 @@ it("RestJsonBodyLongMalformedValueRejected_case5:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18273,7 +18135,6 @@ it("RestJsonBodyLongMalformedValueRejected_case6:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18311,7 +18172,6 @@ it("RestJsonBodyLongMalformedValueRejected_case7:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18349,7 +18209,6 @@ it("RestJsonBodyLongMalformedValueRejected_case8:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18387,7 +18246,6 @@ it("RestJsonBodyLongMalformedValueRejected_case9:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18425,7 +18283,6 @@ it("RestJsonBodyLongMalformedValueRejected_case10:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18460,7 +18317,6 @@ it("RestJsonPathLongMalformedValueRejected_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18495,7 +18351,6 @@ it("RestJsonPathLongMalformedValueRejected_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18530,7 +18385,6 @@ it("RestJsonPathLongMalformedValueRejected_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18565,7 +18419,6 @@ it("RestJsonPathLongMalformedValueRejected_case3:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18600,7 +18453,6 @@ it("RestJsonPathLongMalformedValueRejected_case4:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18635,7 +18487,6 @@ it("RestJsonPathLongMalformedValueRejected_case5:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18670,7 +18521,6 @@ it("RestJsonPathLongMalformedValueRejected_case6:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18707,7 +18557,6 @@ it("RestJsonQueryLongMalformedValueRejected_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18744,7 +18593,6 @@ it("RestJsonQueryLongMalformedValueRejected_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18781,7 +18629,6 @@ it("RestJsonQueryLongMalformedValueRejected_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18818,7 +18665,6 @@ it("RestJsonQueryLongMalformedValueRejected_case3:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18855,7 +18701,6 @@ it("RestJsonQueryLongMalformedValueRejected_case4:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18892,7 +18737,6 @@ it("RestJsonQueryLongMalformedValueRejected_case5:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18929,7 +18773,6 @@ it("RestJsonQueryLongMalformedValueRejected_case6:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -18966,7 +18809,6 @@ it("RestJsonHeaderLongMalformedValueRejected_case0:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19003,7 +18845,6 @@ it("RestJsonHeaderLongMalformedValueRejected_case1:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19040,7 +18881,6 @@ it("RestJsonHeaderLongMalformedValueRejected_case2:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19077,7 +18917,6 @@ it("RestJsonHeaderLongMalformedValueRejected_case3:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19114,7 +18953,6 @@ it("RestJsonHeaderLongMalformedValueRejected_case4:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19151,7 +18989,6 @@ it("RestJsonHeaderLongMalformedValueRejected_case5:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19188,7 +19025,6 @@ it("RestJsonHeaderLongMalformedValueRejected_case6:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19227,7 +19063,6 @@ it("RestJsonBodyMalformedMapNullKey:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19266,7 +19101,6 @@ it.skip("RestJsonBodyMalformedMapNullValue:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19305,7 +19139,6 @@ it("RestJsonInvalidJsonBody_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19344,7 +19177,6 @@ it("RestJsonInvalidJsonBody_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19383,7 +19215,6 @@ it("RestJsonInvalidJsonBody_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19422,7 +19253,6 @@ it("RestJsonInvalidJsonBody_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19461,7 +19291,6 @@ it("RestJsonInvalidJsonBody_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19500,7 +19329,6 @@ it("RestJsonInvalidJsonBody_case5:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19539,7 +19367,6 @@ it("RestJsonInvalidJsonBody_case6:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19578,7 +19405,6 @@ it("RestJsonInvalidJsonBody_case7:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19617,7 +19443,6 @@ it("RestJsonTechnicallyValidJsonBody_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19656,7 +19481,6 @@ it("RestJsonTechnicallyValidJsonBody_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19695,7 +19519,6 @@ it("RestJsonTechnicallyValidJsonBody_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19733,7 +19556,6 @@ it("RestJsonBodyShortUnderflowOverflow_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19771,7 +19593,6 @@ it("RestJsonBodyShortUnderflowOverflow_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19809,7 +19630,6 @@ it("RestJsonBodyShortUnderflowOverflow_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19847,7 +19667,6 @@ it("RestJsonBodyShortUnderflowOverflow_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19885,7 +19704,6 @@ it("RestJsonBodyShortUnderflowOverflow_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19920,7 +19738,6 @@ it("RestJsonPathShortUnderflowOverflow_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19955,7 +19772,6 @@ it("RestJsonPathShortUnderflowOverflow_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -19990,7 +19806,6 @@ it("RestJsonPathShortUnderflowOverflow_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20025,7 +19840,6 @@ it("RestJsonPathShortUnderflowOverflow_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20060,7 +19874,6 @@ it("RestJsonPathShortUnderflowOverflow_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20097,7 +19910,6 @@ it("RestJsonQueryShortUnderflowOverflow_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20134,7 +19946,6 @@ it("RestJsonQueryShortUnderflowOverflow_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20171,7 +19982,6 @@ it("RestJsonQueryShortUnderflowOverflow_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20208,7 +20018,6 @@ it("RestJsonQueryShortUnderflowOverflow_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20245,7 +20054,6 @@ it("RestJsonQueryShortUnderflowOverflow_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20282,7 +20090,6 @@ it("RestJsonHeaderShortUnderflowOverflow_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20319,7 +20126,6 @@ it("RestJsonHeaderShortUnderflowOverflow_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20356,7 +20162,6 @@ it("RestJsonHeaderShortUnderflowOverflow_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20393,7 +20198,6 @@ it("RestJsonHeaderShortUnderflowOverflow_case3:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20430,7 +20234,6 @@ it("RestJsonHeaderShortUnderflowOverflow_case4:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20468,7 +20271,6 @@ it("RestJsonBodyShortMalformedValueRejected_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20506,7 +20308,6 @@ it("RestJsonBodyShortMalformedValueRejected_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20544,7 +20345,6 @@ it("RestJsonBodyShortMalformedValueRejected_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20582,7 +20382,6 @@ it("RestJsonBodyShortMalformedValueRejected_case3:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20620,7 +20419,6 @@ it("RestJsonBodyShortMalformedValueRejected_case4:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20658,7 +20456,6 @@ it("RestJsonBodyShortMalformedValueRejected_case5:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20696,7 +20493,6 @@ it("RestJsonBodyShortMalformedValueRejected_case6:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20734,7 +20530,6 @@ it("RestJsonBodyShortMalformedValueRejected_case7:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20772,7 +20567,6 @@ it("RestJsonBodyShortMalformedValueRejected_case8:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20810,7 +20604,6 @@ it("RestJsonBodyShortMalformedValueRejected_case9:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20848,7 +20641,6 @@ it("RestJsonBodyShortMalformedValueRejected_case10:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20883,7 +20675,6 @@ it("RestJsonPathShortMalformedValueRejected_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20918,7 +20709,6 @@ it("RestJsonPathShortMalformedValueRejected_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20953,7 +20743,6 @@ it("RestJsonPathShortMalformedValueRejected_case2:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -20988,7 +20777,6 @@ it("RestJsonPathShortMalformedValueRejected_case3:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21023,7 +20811,6 @@ it("RestJsonPathShortMalformedValueRejected_case4:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21058,7 +20845,6 @@ it("RestJsonPathShortMalformedValueRejected_case5:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21093,7 +20879,6 @@ it("RestJsonPathShortMalformedValueRejected_case6:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21130,7 +20915,6 @@ it("RestJsonQueryShortMalformedValueRejected_case0:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21167,7 +20951,6 @@ it("RestJsonQueryShortMalformedValueRejected_case1:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21204,7 +20987,6 @@ it("RestJsonQueryShortMalformedValueRejected_case2:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21241,7 +21023,6 @@ it("RestJsonQueryShortMalformedValueRejected_case3:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21278,7 +21059,6 @@ it("RestJsonQueryShortMalformedValueRejected_case4:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21315,7 +21095,6 @@ it("RestJsonQueryShortMalformedValueRejected_case5:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21352,7 +21131,6 @@ it("RestJsonQueryShortMalformedValueRejected_case6:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21389,7 +21167,6 @@ it("RestJsonHeaderShortMalformedValueRejected_case0:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21426,7 +21203,6 @@ it("RestJsonHeaderShortMalformedValueRejected_case1:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21463,7 +21239,6 @@ it("RestJsonHeaderShortMalformedValueRejected_case2:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21500,7 +21275,6 @@ it("RestJsonHeaderShortMalformedValueRejected_case3:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21537,7 +21311,6 @@ it("RestJsonHeaderShortMalformedValueRejected_case4:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21574,7 +21347,6 @@ it("RestJsonHeaderShortMalformedValueRejected_case5:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21611,7 +21383,6 @@ it("RestJsonHeaderShortMalformedValueRejected_case6:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21651,7 +21422,6 @@ it("RestJsonHeaderMalformedStringInvalidBase64MediaType_case0:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21691,7 +21461,6 @@ it("RestJsonHeaderMalformedStringInvalidBase64MediaType_case1:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21731,7 +21500,6 @@ it("RestJsonHeaderMalformedStringInvalidBase64MediaType_case2:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21771,7 +21539,6 @@ it("RestJsonHeaderMalformedStringInvalidBase64MediaType_case3:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21810,7 +21577,6 @@ it("RestJsonBodyTimestampDateTimeRejectsHttpDate_case0:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21849,7 +21615,6 @@ it("RestJsonBodyTimestampDateTimeRejectsEpochSeconds_case0:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21888,7 +21653,6 @@ it("RestJsonBodyTimestampDateTimeRejectsEpochSeconds_case1:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21927,7 +21691,6 @@ it("RestJsonBodyTimestampDateTimeRejectsUTCOffsets_case0:MalformedRequest", asyn expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -21966,7 +21729,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case0:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22005,7 +21767,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case1:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22044,7 +21805,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case2:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22083,7 +21843,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case3:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22122,7 +21881,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case4:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22161,7 +21919,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case5:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22200,7 +21957,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case6:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22239,7 +21995,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case7:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22278,7 +22033,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case8:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22317,7 +22071,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case9:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22356,7 +22109,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case10:MalformedReq expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22395,7 +22147,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case11:MalformedReq expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22434,7 +22185,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case12:MalformedReq expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22473,7 +22223,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case13:MalformedReq expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22512,7 +22261,6 @@ it("RestJsonBodyTimestampDateTimeRejectsDifferent8601Formats_case14:MalformedReq expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22551,7 +22299,6 @@ it.skip("RestJsonBodyTimestampDefaultRejectsDateTime_case0:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22590,7 +22337,6 @@ it.skip("RestJsonBodyTimestampDefaultRejectsDateTime_case1:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22629,7 +22375,6 @@ it.skip("RestJsonBodyTimestampDefaultRejectsDateTime_case2:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22668,7 +22413,6 @@ it.skip("RestJsonBodyTimestampDefaultRejectsStringifiedEpochSeconds_case0:Malfor expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22707,7 +22451,6 @@ it.skip("RestJsonBodyTimestampDefaultRejectsStringifiedEpochSeconds_case1:Malfor expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22745,7 +22488,6 @@ it("RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case0:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22783,7 +22525,6 @@ it("RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case1:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22821,7 +22562,6 @@ it("RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case2:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22859,7 +22599,6 @@ it("RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case3:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22897,7 +22636,6 @@ it("RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case4:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22935,7 +22673,6 @@ it("RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case5:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -22973,7 +22710,6 @@ it("RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case6:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23011,7 +22747,6 @@ it("RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case7:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23049,7 +22784,6 @@ it("RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case8:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23087,7 +22821,6 @@ it("RestJsonBodyTimestampDefaultRejectsMalformedEpochSeconds_case9:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23126,7 +22859,6 @@ it("RestJsonBodyTimestampDefaultRejectsHttpDate_case0:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23165,7 +22897,6 @@ it("RestJsonBodyTimestampHttpDateRejectsDateTime_case0:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23204,7 +22935,6 @@ it("RestJsonBodyTimestampHttpDateRejectsDateTime_case1:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23243,7 +22973,6 @@ it("RestJsonBodyTimestampHttpDateRejectsDateTime_case2:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23282,7 +23011,6 @@ it("RestJsonBodyTimestampHttpDateRejectsEpoch_case0:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23321,7 +23049,6 @@ it("RestJsonBodyTimestampHttpDateRejectsEpoch_case1:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23359,7 +23086,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsHttpDate_case0:MalformedRequest", asyn expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23397,7 +23123,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsEpochSeconds_case0:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23435,7 +23160,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsEpochSeconds_case1:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23473,7 +23197,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case0:MalformedRe expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23511,7 +23234,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case1:MalformedRe expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23549,7 +23271,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case2:MalformedRe expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23587,7 +23308,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case3:MalformedRe expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23625,7 +23345,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case4:MalformedRe expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23663,7 +23382,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case5:MalformedRe expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23701,7 +23419,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case6:MalformedRe expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23739,7 +23456,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case7:MalformedRe expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23777,7 +23493,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case8:MalformedRe expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23815,7 +23530,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case9:MalformedRe expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23853,7 +23567,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case10:MalformedR expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23891,7 +23604,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case11:MalformedR expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23929,7 +23641,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case12:MalformedR expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -23967,7 +23678,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case13:MalformedR expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24005,7 +23715,6 @@ it("RestJsonHeaderTimestampDateTimeRejectsDifferent8601Formats_case14:MalformedR expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24043,7 +23752,6 @@ it("RestJsonHeaderTimestampDefaultRejectsDateTime_case0:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24081,7 +23789,6 @@ it("RestJsonHeaderTimestampDefaultRejectsDateTime_case1:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24119,7 +23826,6 @@ it("RestJsonHeaderTimestampDefaultRejectsDateTime_case2:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24157,7 +23863,6 @@ it("RestJsonHeaderTimestampDefaultRejectsEpochSeconds_case0:MalformedRequest", a expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24195,7 +23900,6 @@ it("RestJsonHeaderTimestampDefaultRejectsEpochSeconds_case1:MalformedRequest", a expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24233,7 +23937,6 @@ it("RestJsonHeaderTimestampEpochRejectsDateTime_case0:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24271,7 +23974,6 @@ it("RestJsonHeaderTimestampEpochRejectsDateTime_case1:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24309,7 +24011,6 @@ it("RestJsonHeaderTimestampEpochRejectsDateTime_case2:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24347,7 +24048,6 @@ it("RestJsonHeaderTimestampEpochRejectsHttpDate_case0:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24384,7 +24084,6 @@ it("RestJsonHeaderTimestampEpochRejectsMalformedValues_case0:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24421,7 +24120,6 @@ it("RestJsonHeaderTimestampEpochRejectsMalformedValues_case1:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24458,7 +24156,6 @@ it("RestJsonHeaderTimestampEpochRejectsMalformedValues_case2:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24495,7 +24192,6 @@ it("RestJsonHeaderTimestampEpochRejectsMalformedValues_case3:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24532,7 +24228,6 @@ it("RestJsonHeaderTimestampEpochRejectsMalformedValues_case4:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24569,7 +24264,6 @@ it("RestJsonHeaderTimestampEpochRejectsMalformedValues_case5:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24606,7 +24300,6 @@ it("RestJsonHeaderTimestampEpochRejectsMalformedValues_case6:MalformedRequest", expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24642,7 +24335,6 @@ it("RestJsonPathTimestampDefaultRejectsHttpDate_case0:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24678,7 +24370,6 @@ it("RestJsonPathTimestampDefaultRejectsHttpDate_case1:MalformedRequest", async ( expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24714,7 +24405,6 @@ it("RestJsonPathTimestampDefaultRejectsEpochSeconds_case0:MalformedRequest", asy expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24750,7 +24440,6 @@ it("RestJsonPathTimestampDefaultRejectsEpochSeconds_case1:MalformedRequest", asy expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24786,7 +24475,6 @@ it("RestJsonPathTimestampDefaultRejectsUTCOffsets:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24822,7 +24510,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case0:MalformedReque expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24858,7 +24545,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case1:MalformedReque expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24894,7 +24580,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case2:MalformedReque expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24930,7 +24615,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case3:MalformedReque expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -24966,7 +24650,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case4:MalformedReque expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25002,7 +24685,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case5:MalformedReque expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25038,7 +24720,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case6:MalformedReque expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25074,7 +24755,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case7:MalformedReque expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25110,7 +24790,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case8:MalformedReque expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25146,7 +24825,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case9:MalformedReque expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25182,7 +24860,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case10:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25218,7 +24895,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case11:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25254,7 +24930,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case12:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25290,7 +24965,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case13:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25326,7 +25000,6 @@ it("RestJsonPathTimestampDefaultRejectsDifferent8601Formats_case14:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25362,7 +25035,6 @@ it("RestJsonPathTimestampEpochRejectsDateTime_case0:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25398,7 +25070,6 @@ it("RestJsonPathTimestampEpochRejectsDateTime_case1:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25434,7 +25105,6 @@ it("RestJsonPathTimestampEpochRejectsDateTime_case2:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25470,7 +25140,6 @@ it("RestJsonPathTimestampEpochRejectsHttpDate_case0:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25506,7 +25175,6 @@ it("RestJsonPathTimestampEpochRejectsHttpDate_case1:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25541,7 +25209,6 @@ it("RestJsonPathTimestampEpochRejectsMalformedValues_case0:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25576,7 +25243,6 @@ it("RestJsonPathTimestampEpochRejectsMalformedValues_case1:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25611,7 +25277,6 @@ it("RestJsonPathTimestampEpochRejectsMalformedValues_case2:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25646,7 +25311,6 @@ it("RestJsonPathTimestampEpochRejectsMalformedValues_case3:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25681,7 +25345,6 @@ it("RestJsonPathTimestampEpochRejectsMalformedValues_case4:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25716,7 +25379,6 @@ it("RestJsonPathTimestampEpochRejectsMalformedValues_case5:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25751,7 +25413,6 @@ it("RestJsonPathTimestampEpochRejectsMalformedValues_case6:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25787,7 +25448,6 @@ it("RestJsonPathTimestampHttpDateRejectsDateTime_case0:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25823,7 +25483,6 @@ it("RestJsonPathTimestampHttpDateRejectsDateTime_case1:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25859,7 +25518,6 @@ it("RestJsonPathTimestampHttpDateRejectsDateTime_case2:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25895,7 +25553,6 @@ it("RestJsonPathTimestampHttpDateRejectsEpochSeconds_case0:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25931,7 +25588,6 @@ it("RestJsonPathTimestampHttpDateRejectsEpochSeconds_case1:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -25969,7 +25625,6 @@ it("RestJsonQueryTimestampDefaultRejectsHttpDate_case0:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26007,7 +25662,6 @@ it("RestJsonQueryTimestampDefaultRejectsHttpDate_case1:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26045,7 +25699,6 @@ it("RestJsonQueryTimestampDefaultRejectsEpochSeconds_case0:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26083,7 +25736,6 @@ it("RestJsonQueryTimestampDefaultRejectsEpochSeconds_case1:MalformedRequest", as expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26121,7 +25773,6 @@ it("RestJsonQueryTimestampDefaultRejectsUTCOffsets:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26159,7 +25810,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case0:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26197,7 +25847,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case1:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26235,7 +25884,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case2:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26273,7 +25921,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case3:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26311,7 +25958,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case4:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26349,7 +25995,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case5:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26387,7 +26032,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case6:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26425,7 +26069,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case7:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26463,7 +26106,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case8:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26501,7 +26143,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case9:MalformedRequ expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26539,7 +26180,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case10:MalformedReq expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26577,7 +26217,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case11:MalformedReq expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26615,7 +26254,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case12:MalformedReq expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26653,7 +26291,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case13:MalformedReq expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26691,7 +26328,6 @@ it("RestJsonQueryTimestampDefaultRejectsDifferent8601Formats_case14:MalformedReq expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26729,7 +26365,6 @@ it("RestJsonQueryTimestampEpochRejectsDateTime_case0:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26767,7 +26402,6 @@ it("RestJsonQueryTimestampEpochRejectsDateTime_case1:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26805,7 +26439,6 @@ it("RestJsonQueryTimestampEpochRejectsDateTime_case2:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26843,7 +26476,6 @@ it("RestJsonQueryTimestampEpochRejectsHttpDate_case0:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26881,7 +26513,6 @@ it("RestJsonQueryTimestampEpochRejectsHttpDate_case1:MalformedRequest", async () expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26918,7 +26549,6 @@ it("RestJsonQueryTimestampEpochRejectsMalformedValues_case0:MalformedRequest", a expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26955,7 +26585,6 @@ it("RestJsonQueryTimestampEpochRejectsMalformedValues_case1:MalformedRequest", a expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -26992,7 +26621,6 @@ it("RestJsonQueryTimestampEpochRejectsMalformedValues_case2:MalformedRequest", a expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27029,7 +26657,6 @@ it("RestJsonQueryTimestampEpochRejectsMalformedValues_case3:MalformedRequest", a expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27066,7 +26693,6 @@ it("RestJsonQueryTimestampEpochRejectsMalformedValues_case4:MalformedRequest", a expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27103,7 +26729,6 @@ it("RestJsonQueryTimestampEpochRejectsMalformedValues_case5:MalformedRequest", a expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27140,7 +26765,6 @@ it("RestJsonQueryTimestampEpochRejectsMalformedValues_case6:MalformedRequest", a expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27178,7 +26802,6 @@ it("RestJsonQueryTimestampHttpDateRejectsDateTime_case0:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27216,7 +26839,6 @@ it("RestJsonQueryTimestampHttpDateRejectsDateTime_case1:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27254,7 +26876,6 @@ it("RestJsonQueryTimestampHttpDateRejectsDateTime_case2:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27292,7 +26913,6 @@ it("RestJsonQueryTimestampHttpDateRejectsEpochSeconds_case0:MalformedRequest", a expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27330,7 +26950,6 @@ it("RestJsonQueryTimestampHttpDateRejectsEpochSeconds_case1:MalformedRequest", a expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27369,7 +26988,6 @@ it("RestJsonMalformedUnionMultipleFieldsSet:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27408,7 +27026,6 @@ it("RestJsonMalformedUnionKnownAndUnknownFieldsSet:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27447,7 +27064,6 @@ it("RestJsonMalformedUnionNoFieldsSet:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27486,7 +27102,6 @@ it("RestJsonMalformedUnionEmptyObjectNoFieldsSet:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27525,7 +27140,6 @@ it("RestJsonMalformedUnionValueIsArray:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27564,7 +27178,6 @@ it.skip("RestJsonMalformedUnionUnknownMember:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("SerializationException"); }); @@ -27607,7 +27220,10 @@ it("MediaTypeHeaderInputBase64:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -27658,7 +27274,6 @@ it("MediaTypeHeaderOutputBase64:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-json"]).toBeDefined(); expect(r.headers["x-json"]).toBe("dHJ1ZQ=="); }); @@ -27893,10 +27508,9 @@ it("RestJsonNoInputAndOutputWithJson:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -27951,11 +27565,12 @@ it.skip("RestJsonNullAndEmptyHeaders:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-a"]).toBeUndefined(); + expect( + r.headers["x-a"], + `Header key "x-a" should have been undefined in ${JSON.stringify(r.headers)}` + ).toBeUndefined(); - expect(r.headers["x-b"]).toBeDefined(); expect(r.headers["x-b"]).toBe(""); - expect(r.headers["x-c"]).toBeDefined(); expect(r.headers["x-c"]).toBe(""); }); @@ -27998,7 +27613,10 @@ it("RestJsonSerializesEmptyQueryValue:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -28042,7 +27660,10 @@ it("RestJsonServersAcceptStaticQueryParamAsEmptyString:ServerRequest", async () }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -28116,7 +27737,10 @@ it.skip("RestJsonServerPopulatesDefaultsWhenMissingInRequestBody:ServerRequest", }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -28165,10 +27789,9 @@ it.skip("RestJsonServerPopulatesDefaultsInResponseWhenMissingInParams:ServerResp expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"defaultString\": \"hi\", @@ -28285,7 +27908,10 @@ it.skip("RestJsonServerPopulatesNestedDefaultsWhenMissingInRequestBody:ServerReq }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -28364,10 +27990,9 @@ it.skip("RestJsonServerPopulatesNestedDefaultValuesWhenMissingInInResponseParams expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"dialog\": { @@ -28456,7 +28081,10 @@ it("RestJsonInputUnionWithUnitMember:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -28509,10 +28137,9 @@ it("RestJsonOutputUnionWithUnitMember:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"action\": { @@ -28564,7 +28191,10 @@ it("PostUnionWithJsonNameRequest1:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -28610,7 +28240,10 @@ it("PostUnionWithJsonNameRequest2:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -28656,7 +28289,10 @@ it("PostUnionWithJsonNameRequest3:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -28709,10 +28345,9 @@ it("PostUnionWithJsonNameResponse1:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"value\": { @@ -28771,10 +28406,9 @@ it("PostUnionWithJsonNameResponse2:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"value\": { @@ -28833,10 +28467,9 @@ it("PostUnionWithJsonNameResponse3:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"value\": { @@ -28885,7 +28518,10 @@ it.skip("SDKAppliedContentEncoding_restJson1:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -28932,7 +28568,10 @@ it.skip("SDKAppendedGzipAfterProvidedEncoding_restJson1:ServerRequest", async () }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -28981,7 +28620,10 @@ it("RestJsonServersQueryParamsStringListMap:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -29030,7 +28672,10 @@ it("RestJsonServersPutAllQueryParamsInMap:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -29087,7 +28732,10 @@ it("RestJsonRecursiveShapes:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -29149,10 +28797,9 @@ it("RestJsonRecursiveShapes:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"nested\": { @@ -29217,10 +28864,9 @@ it("RestJsonHttpResponseCodeNotSetFallsBackToHttpCode:ServerResponse", async () expect(r.statusCode).toBe(201); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -29273,10 +28919,9 @@ it("RestJsonHttpResponseCodeRequired:ServerResponse", async () => { expect(r.statusCode).toBe(201); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -29334,7 +28979,10 @@ it("RestJsonSimpleScalarProperties:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -29413,7 +29061,10 @@ it("RestJsonSupportsNaNFloatInputs:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -29458,7 +29109,10 @@ it("RestJsonSupportsInfinityFloatInputs:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -29503,7 +29157,10 @@ it("RestJsonSupportsNegativeInfinityFloatInputs:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -29563,12 +29220,10 @@ it("RestJsonSimpleScalarProperties:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"stringValue\": \"string\", @@ -29631,10 +29286,9 @@ it("RestJsonServersDontSerializeNullStructureValues:ServerResponse", async () => expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{}`; const unequalParts: any = compareEquivalentJsonBodies(bodyString, r.body.toString()); @@ -29688,10 +29342,9 @@ it("RestJsonSupportsNaNFloatInputs:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"floatValue\": \"NaN\", @@ -29748,10 +29401,9 @@ it("RestJsonSupportsInfinityFloatInputs:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"floatValue\": \"Infinity\", @@ -29808,10 +29460,9 @@ it("RestJsonSupportsNegativeInfinityFloatInputs:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"floatValue\": \"-Infinity\", @@ -29863,7 +29514,10 @@ it("RestJsonSparseListsSerializeNull:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -29915,10 +29569,9 @@ it("RestJsonSparseListsSerializeNull:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"sparseStringList\": [ @@ -29982,7 +29635,10 @@ it("RestJsonSparseJsonMaps:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -30039,7 +29695,10 @@ it("RestJsonSerializesSparseNullMapValues:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -30090,7 +29749,10 @@ it("RestJsonSerializesZeroValuesInSparseMaps:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -30137,7 +29799,10 @@ it("RestJsonSerializesSparseSetMap:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -30187,7 +29852,10 @@ it("RestJsonSerializesSparseSetMapAndRetainsNull:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -30245,10 +29913,9 @@ it("RestJsonSparseJsonMaps:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"sparseStructMap\": { @@ -30321,10 +29988,9 @@ it("RestJsonDeserializesSparseNullMapValues:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"sparseBooleanMap\": { @@ -30395,10 +30061,9 @@ it("RestJsonDeserializesZeroValuesInSparseMaps:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"sparseNumberMap\": { @@ -30461,10 +30126,9 @@ it("RestJsonDeserializesSparseSetMap:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"sparseSetMap\": { @@ -30526,10 +30190,9 @@ it("RestJsonDeserializesSparseSetMapAndRetainsNull:ServerResponse", async () => expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/json"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"sparseSetMap\": { @@ -30584,7 +30247,10 @@ it("RestJsonStreamingTraitsWithBlob:ServerRequest", async () => { ][0]; const comparableBlob = await __streamCollector(r["blob"]); Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); if (param === "blob") { expect(equivalentContents(paramsToValidate[param], comparableBlob)).toBe(true); } else { @@ -30633,7 +30299,10 @@ it("RestJsonStreamingTraitsWithNoBlobBody:ServerRequest", async () => { ][0]; const comparableBlob = await __streamCollector(r["blob"]); Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); if (param === "blob") { expect(equivalentContents(paramsToValidate[param], comparableBlob)).toBe(true); } else { @@ -30689,12 +30358,10 @@ it("RestJsonStreamingTraitsWithBlob:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("application/octet-stream"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `blobby blob blob`; const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); @@ -30747,7 +30414,6 @@ it("RestJsonStreamingTraitsWithNoBlobBody:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); expect(!r.body || r.body === `{}`).toBeTruthy(); @@ -30795,7 +30461,10 @@ it("RestJsonStreamingTraitsRequireLengthWithBlob:ServerRequest", async () => { ][0]; const comparableBlob = await __streamCollector(r["blob"]); Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); if (param === "blob") { expect(equivalentContents(paramsToValidate[param], comparableBlob)).toBe(true); } else { @@ -30844,7 +30513,10 @@ it("RestJsonStreamingTraitsRequireLengthWithNoBlobBody:ServerRequest", async () ][0]; const comparableBlob = await __streamCollector(r["blob"]); Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); if (param === "blob") { expect(equivalentContents(paramsToValidate[param], comparableBlob)).toBe(true); } else { @@ -30895,7 +30567,10 @@ it("RestJsonStreamingTraitsWithMediaTypeWithBlob:ServerRequest", async () => { ][0]; const comparableBlob = await __streamCollector(r["blob"]); Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); if (param === "blob") { expect(equivalentContents(paramsToValidate[param], comparableBlob)).toBe(true); } else { @@ -30951,12 +30626,10 @@ it("RestJsonStreamingTraitsWithMediaTypeWithBlob:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["content-type"]).toBeDefined(); expect(r.headers["content-type"]).toBe("text/plain"); - expect(r.headers["x-foo"]).toBeDefined(); expect(r.headers["x-foo"]).toBe("Foo"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `blobby blob blob`; const unequalParts: any = compareEquivalentOctetStreamBodies(utf8Encoder, bodyString, r.body); @@ -31004,7 +30677,10 @@ it("RestJsonTestBodyStructure:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -31146,7 +30822,10 @@ it("RestJsonHttpGetWithHeaderMemberNoModeledBody:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -31223,7 +30902,10 @@ it("RestJsonTestPayloadBlob:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -31303,7 +30985,10 @@ it("RestJsonTestPayloadStructure:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -31348,7 +31033,10 @@ it("RestJsonHttpWithHeadersButNoPayload:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -31456,7 +31144,10 @@ it("RestJsonHttpWithPostHeaderMemberNoModeledBody:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -31512,7 +31203,10 @@ it("RestJsonTimestampFormatHeaders:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -31569,19 +31263,12 @@ it("RestJsonTimestampFormatHeaders:ServerResponse", async () => { expect(r.statusCode).toBe(200); - expect(r.headers["x-defaultformat"]).toBeDefined(); expect(r.headers["x-defaultformat"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); - expect(r.headers["x-memberdatetime"]).toBeDefined(); expect(r.headers["x-memberdatetime"]).toBe("2019-12-16T23:48:18Z"); - expect(r.headers["x-memberepochseconds"]).toBeDefined(); expect(r.headers["x-memberepochseconds"]).toBe("1576540098"); - expect(r.headers["x-memberhttpdate"]).toBeDefined(); expect(r.headers["x-memberhttpdate"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); - expect(r.headers["x-targetdatetime"]).toBeDefined(); expect(r.headers["x-targetdatetime"]).toBe("2019-12-16T23:48:18Z"); - expect(r.headers["x-targetepochseconds"]).toBeDefined(); expect(r.headers["x-targetepochseconds"]).toBe("1576540098"); - expect(r.headers["x-targethttpdate"]).toBeDefined(); expect(r.headers["x-targethttpdate"]).toBe("Mon, 16 Dec 2019 23:48:18 GMT"); }); diff --git a/private/aws-restjson-server/vite.config.js b/private/aws-restjson-server/vite.config.js new file mode 100644 index 000000000000..e7147d3ac9e1 --- /dev/null +++ b/private/aws-restjson-server/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/private/aws-restjson-validation-server/package.json b/private/aws-restjson-validation-server/package.json index 2f72b9241cf0..fa6c3e62a2ed 100644 --- a/private/aws-restjson-validation-server/package.json +++ b/private/aws-restjson-validation-server/package.json @@ -50,7 +50,8 @@ "concurrently": "7.0.0", "downlevel-dts": "0.10.1", "rimraf": "3.0.2", - "typescript": "~5.2.2" + "typescript": "~5.2.2", + "vitest": "2.1.8" }, "engines": { "node": ">=18.0.0" diff --git a/private/aws-restjson-validation-server/test/functional/restjson1.spec.ts b/private/aws-restjson-validation-server/test/functional/restjson1.spec.ts index 53bfc19d08b0..38e76d5cfacd 100644 --- a/private/aws-restjson-validation-server/test/functional/restjson1.spec.ts +++ b/private/aws-restjson-validation-server/test/functional/restjson1.spec.ts @@ -3,6 +3,7 @@ import { HttpHandler, HttpRequest, HttpResponse } from "@smithy/protocol-http"; import { Endpoint, HeaderBag, HttpHandlerOptions } from "@smithy/types"; import { toUtf8 as __utf8Encoder } from "@smithy/util-utf8"; import { Readable } from "stream"; +import { expect, test as it } from "vitest"; import { getRestJsonValidationServiceHandler } from "../../src/server"; import { MalformedEnum } from "../../src/server/operations/MalformedEnum"; @@ -242,10 +243,9 @@ it("RestJsonMalformedEnumString_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/string' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"fieldList\" : [{\"message\": \"Value at '/string' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"path\": \"/string\"}]}`; @@ -281,10 +281,9 @@ it("RestJsonMalformedEnumString_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/string' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"fieldList\" : [{\"message\": \"Value at '/string' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"path\": \"/string\"}]}`; @@ -320,10 +319,9 @@ it("RestJsonMalformedEnumTraitString_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/stringWithEnumTrait' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]\", \"fieldList\" : [{\"message\": \"Value at '/stringWithEnumTrait' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]\", \"path\": \"/stringWithEnumTrait\"}]}`; @@ -359,10 +357,9 @@ it("RestJsonMalformedEnumTraitString_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/stringWithEnumTrait' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]\", \"fieldList\" : [{\"message\": \"Value at '/stringWithEnumTrait' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]\", \"path\": \"/stringWithEnumTrait\"}]}`; @@ -398,10 +395,9 @@ it("RestJsonMalformedEnumList_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/list/0' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"fieldList\" : [{\"message\": \"Value at '/list/0' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"path\": \"/list/0\"}]}`; @@ -437,10 +433,9 @@ it("RestJsonMalformedEnumList_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/list/0' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"fieldList\" : [{\"message\": \"Value at '/list/0' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"path\": \"/list/0\"}]}`; @@ -476,10 +471,9 @@ it("RestJsonMalformedEnumMapKey_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/map' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"fieldList\" : [{\"message\": \"Value at '/map' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"path\": \"/map\"}]}`; @@ -515,10 +509,9 @@ it("RestJsonMalformedEnumMapKey_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/map' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"fieldList\" : [{\"message\": \"Value at '/map' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"path\": \"/map\"}]}`; @@ -554,10 +547,9 @@ it("RestJsonMalformedEnumMapValue_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/map/abc' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"fieldList\" : [{\"message\": \"Value at '/map/abc' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"path\": \"/map/abc\"}]}`; @@ -593,10 +585,9 @@ it("RestJsonMalformedEnumMapValue_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/map/abc' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"fieldList\" : [{\"message\": \"Value at '/map/abc' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"path\": \"/map/abc\"}]}`; @@ -632,10 +623,9 @@ it("RestJsonMalformedEnumUnion_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/union/first' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"fieldList\" : [{\"message\": \"Value at '/union/first' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"path\": \"/union/first\"}]}`; @@ -671,10 +661,9 @@ it("RestJsonMalformedEnumUnion_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/union/first' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"fieldList\" : [{\"message\": \"Value at '/union/first' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"path\": \"/union/first\"}]}`; @@ -709,10 +698,9 @@ it("RestJsonMalformedLengthBlob_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 1 at '/blob' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 1 at '/blob' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/blob\"}]}`; @@ -747,10 +735,9 @@ it("RestJsonMalformedLengthBlob_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 26 at '/blob' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 26 at '/blob' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/blob\"}]}`; @@ -785,10 +772,9 @@ it("RestJsonMalformedLengthString_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 1 at '/string' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 1 at '/string' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/string\"}]}`; @@ -823,10 +809,9 @@ it("RestJsonMalformedLengthString_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 26 at '/string' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 26 at '/string' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/string\"}]}`; @@ -861,10 +846,9 @@ it("RestJsonMalformedLengthString_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 1 at '/string' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 1 at '/string' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/string\"}]}`; @@ -899,10 +883,9 @@ it("RestJsonMalformedLengthMinString:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 1 at '/minString' failed to satisfy constraint: Member must have length greater than or equal to 2\", \"fieldList\" : [{\"message\": \"Value with length 1 at '/minString' failed to satisfy constraint: Member must have length greater than or equal to 2\", \"path\": \"/minString\"}]}`; @@ -937,10 +920,9 @@ it("RestJsonMalformedLengthMaxString:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 26 at '/maxString' failed to satisfy constraint: Member must have length less than or equal to 8\", \"fieldList\" : [{\"message\": \"Value with length 26 at '/maxString' failed to satisfy constraint: Member must have length less than or equal to 8\", \"path\": \"/maxString\"}]}`; @@ -975,10 +957,9 @@ it("RestJsonMalformedLengthList_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 1 at '/list' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 1 at '/list' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/list\"}]}`; @@ -1013,10 +994,9 @@ it("RestJsonMalformedLengthList_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 10 at '/list' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 10 at '/list' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/list\"}]}`; @@ -1051,10 +1031,9 @@ it("RestJsonMalformedLengthListValue_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 1 at '/list/0' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 1 at '/list/0' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/list/0\"}]}`; @@ -1089,10 +1068,9 @@ it("RestJsonMalformedLengthListValue_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 26 at '/list/0' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 26 at '/list/0' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/list/0\"}]}`; @@ -1127,10 +1105,9 @@ it("RestJsonMalformedLengthMap_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 1 at '/map' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 1 at '/map' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/map\"}]}`; @@ -1167,10 +1144,9 @@ it("RestJsonMalformedLengthMap_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 10 at '/map' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 10 at '/map' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/map\"}]}`; @@ -1207,10 +1183,9 @@ it("RestJsonMalformedLengthMapKey_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 1 at '/map' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 1 at '/map' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/map\"}]}`; @@ -1247,10 +1222,9 @@ it("RestJsonMalformedLengthMapKey_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 26 at '/map' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 26 at '/map' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/map\"}]}`; @@ -1285,10 +1259,9 @@ it("RestJsonMalformedLengthMapValue_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 1 at '/map/abc' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 1 at '/map/abc' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/map/abc\"}]}`; @@ -1325,10 +1298,9 @@ it("RestJsonMalformedLengthMapValue_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 10 at '/map/abc' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 10 at '/map/abc' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/map/abc\"}]}`; @@ -1363,10 +1335,9 @@ it("RestJsonMalformedLengthBlobOverride_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 3 at '/blob' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 3 at '/blob' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"path\": \"/blob\"}]}`; @@ -1401,10 +1372,9 @@ it("RestJsonMalformedLengthBlobOverride_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 7 at '/blob' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 7 at '/blob' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"path\": \"/blob\"}]}`; @@ -1439,10 +1409,9 @@ it("RestJsonMalformedLengthStringOverride_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 3 at '/string' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 3 at '/string' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"path\": \"/string\"}]}`; @@ -1477,10 +1446,9 @@ it("RestJsonMalformedLengthStringOverride_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 7 at '/string' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 7 at '/string' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"path\": \"/string\"}]}`; @@ -1515,10 +1483,9 @@ it("RestJsonMalformedLengthStringOverride_case2:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 3 at '/string' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 3 at '/string' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"path\": \"/string\"}]}`; @@ -1553,10 +1520,9 @@ it("RestJsonMalformedLengthMinStringOverride:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 3 at '/minString' failed to satisfy constraint: Member must have length greater than or equal to 4\", \"fieldList\" : [{\"message\": \"Value with length 3 at '/minString' failed to satisfy constraint: Member must have length greater than or equal to 4\", \"path\": \"/minString\"}]}`; @@ -1591,10 +1557,9 @@ it("RestJsonMalformedLengthMaxStringOverride:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 7 at '/maxString' failed to satisfy constraint: Member must have length less than or equal to 6\", \"fieldList\" : [{\"message\": \"Value with length 7 at '/maxString' failed to satisfy constraint: Member must have length less than or equal to 6\", \"path\": \"/maxString\"}]}`; @@ -1629,10 +1594,9 @@ it("RestJsonMalformedLengthListOverride_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 3 at '/list' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 3 at '/list' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"path\": \"/list\"}]}`; @@ -1667,10 +1631,9 @@ it("RestJsonMalformedLengthListOverride_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 7 at '/list' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 7 at '/list' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"path\": \"/list\"}]}`; @@ -1707,10 +1670,9 @@ it("RestJsonMalformedLengthMapOverride_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 3 at '/map' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 3 at '/map' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"path\": \"/map\"}]}`; @@ -1747,10 +1709,9 @@ it("RestJsonMalformedLengthMapOverride_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 7 at '/map' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 7 at '/map' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"path\": \"/map\"}]}`; @@ -1787,10 +1748,9 @@ it("RestJsonMalformedLengthQueryStringNoValue:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value with length 0 at '/string' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value with length 0 at '/string' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/string\"}]}`; @@ -1825,10 +1785,9 @@ it("RestJsonMalformedPatternString_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/string\"}]}`; @@ -1863,10 +1822,9 @@ it("RestJsonMalformedPatternString_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/string\"}]}`; @@ -1903,10 +1861,9 @@ it.skip("RestJsonMalformedPatternReDOSString:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/evilString' failed to satisfy constraint: Member must satisfy regular expression pattern: ^([0-9]+)+$$\", \"fieldList\" : [{\"message\": \"Value at '/evilString' failed to satisfy constraint: Member must satisfy regular expression pattern: ^([0-9]+)+$$\", \"path\": \"/evilString\"}]}`; @@ -1941,10 +1898,9 @@ it("RestJsonMalformedPatternList_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/list/0\"}]}`; @@ -1979,10 +1935,9 @@ it("RestJsonMalformedPatternList_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/list/0\"}]}`; @@ -2017,10 +1972,9 @@ it("RestJsonMalformedPatternMapKey_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/map\"}]}`; @@ -2055,10 +2009,9 @@ it("RestJsonMalformedPatternMapKey_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/map\"}]}`; @@ -2093,10 +2046,9 @@ it("RestJsonMalformedPatternMapValue_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/map/abc' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/map/abc' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/map/abc\"}]}`; @@ -2131,10 +2083,9 @@ it("RestJsonMalformedPatternMapValue_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/map/abc' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/map/abc' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/map/abc\"}]}`; @@ -2169,10 +2120,9 @@ it("RestJsonMalformedPatternUnion_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/union/first\"}]}`; @@ -2207,10 +2157,9 @@ it("RestJsonMalformedPatternUnion_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/union/first\"}]}`; @@ -2245,10 +2194,9 @@ it("RestJsonMalformedPatternStringOverride_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"path\": \"/string\"}]}`; @@ -2283,10 +2231,9 @@ it("RestJsonMalformedPatternStringOverride_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"path\": \"/string\"}]}`; @@ -2321,10 +2268,9 @@ it("RestJsonMalformedPatternListOverride_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"path\": \"/list/0\"}]}`; @@ -2359,10 +2305,9 @@ it("RestJsonMalformedPatternListOverride_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/list/0' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"path\": \"/list/0\"}]}`; @@ -2397,10 +2342,9 @@ it("RestJsonMalformedPatternMapKeyOverride_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"path\": \"/map\"}]}`; @@ -2435,10 +2379,9 @@ it("RestJsonMalformedPatternMapKeyOverride_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/map' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"path\": \"/map\"}]}`; @@ -2473,10 +2416,9 @@ it("RestJsonMalformedPatternMapValueOverride_case0:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/map/ghi' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/map/ghi' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"path\": \"/map/ghi\"}]}`; @@ -2511,10 +2453,9 @@ it("RestJsonMalformedPatternMapValueOverride_case1:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/map/ghi' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/map/ghi' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"path\": \"/map/ghi\"}]}`; @@ -2549,10 +2490,9 @@ it("RestJsonMalformedPatternUnionOverride_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"path\": \"/union/first\"}]}`; @@ -2587,10 +2527,9 @@ it("RestJsonMalformedPatternUnionOverride_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"path\": \"/union/first\"}]}`; @@ -2625,10 +2564,9 @@ it("RestJsonMalformedRangeByte_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/byte' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/byte' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"path\": \"/byte\"}]}`; @@ -2663,10 +2601,9 @@ it("RestJsonMalformedRangeByte_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/byte' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/byte' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"path\": \"/byte\"}]}`; @@ -2701,10 +2638,9 @@ it("RestJsonMalformedRangeMinByte:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/minByte' failed to satisfy constraint: Member must be greater than or equal to 2\", \"fieldList\" : [{\"message\": \"Value at '/minByte' failed to satisfy constraint: Member must be greater than or equal to 2\", \"path\": \"/minByte\"}]}`; @@ -2739,10 +2675,9 @@ it("RestJsonMalformedRangeMaxByte:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/maxByte' failed to satisfy constraint: Member must be less than or equal to 8\", \"fieldList\" : [{\"message\": \"Value at '/maxByte' failed to satisfy constraint: Member must be less than or equal to 8\", \"path\": \"/maxByte\"}]}`; @@ -2777,10 +2712,9 @@ it("RestJsonMalformedRangeFloat_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/float' failed to satisfy constraint: Member must be between 2.2 and 8.8, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/float' failed to satisfy constraint: Member must be between 2.2 and 8.8, inclusive\", \"path\": \"/float\"}]}`; @@ -2815,10 +2749,9 @@ it("RestJsonMalformedRangeFloat_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/float' failed to satisfy constraint: Member must be between 2.2 and 8.8, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/float' failed to satisfy constraint: Member must be between 2.2 and 8.8, inclusive\", \"path\": \"/float\"}]}`; @@ -2853,10 +2786,9 @@ it("RestJsonMalformedRangeMinFloat:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/minFloat' failed to satisfy constraint: Member must be greater than or equal to 2.2\", \"fieldList\" : [{\"message\": \"Value at '/minFloat' failed to satisfy constraint: Member must be greater than or equal to 2.2\", \"path\": \"/minFloat\"}]}`; @@ -2891,10 +2823,9 @@ it("RestJsonMalformedRangeMaxFloat:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/maxFloat' failed to satisfy constraint: Member must be less than or equal to 8.8\", \"fieldList\" : [{\"message\": \"Value at '/maxFloat' failed to satisfy constraint: Member must be less than or equal to 8.8\", \"path\": \"/maxFloat\"}]}`; @@ -2929,10 +2860,9 @@ it("RestJsonMalformedRangeShort_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/short' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/short' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"path\": \"/short\"}]}`; @@ -2967,10 +2897,9 @@ it("RestJsonMalformedRangeShort_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/short' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/short' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"path\": \"/short\"}]}`; @@ -3005,10 +2934,9 @@ it("RestJsonMalformedRangeMinShort:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/minShort' failed to satisfy constraint: Member must be greater than or equal to 2\", \"fieldList\" : [{\"message\": \"Value at '/minShort' failed to satisfy constraint: Member must be greater than or equal to 2\", \"path\": \"/minShort\"}]}`; @@ -3043,10 +2971,9 @@ it("RestJsonMalformedRangeMaxShort:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/maxShort' failed to satisfy constraint: Member must be less than or equal to 8\", \"fieldList\" : [{\"message\": \"Value at '/maxShort' failed to satisfy constraint: Member must be less than or equal to 8\", \"path\": \"/maxShort\"}]}`; @@ -3081,10 +3008,9 @@ it("RestJsonMalformedRangeInteger_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/integer' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/integer' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"path\": \"/integer\"}]}`; @@ -3119,10 +3045,9 @@ it("RestJsonMalformedRangeInteger_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/integer' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/integer' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"path\": \"/integer\"}]}`; @@ -3157,10 +3082,9 @@ it("RestJsonMalformedRangeMinInteger:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/minInteger' failed to satisfy constraint: Member must be greater than or equal to 2\", \"fieldList\" : [{\"message\": \"Value at '/minInteger' failed to satisfy constraint: Member must be greater than or equal to 2\", \"path\": \"/minInteger\"}]}`; @@ -3195,10 +3119,9 @@ it("RestJsonMalformedRangeMaxInteger:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/maxInteger' failed to satisfy constraint: Member must be less than or equal to 8\", \"fieldList\" : [{\"message\": \"Value at '/maxInteger' failed to satisfy constraint: Member must be less than or equal to 8\", \"path\": \"/maxInteger\"}]}`; @@ -3233,10 +3156,9 @@ it("RestJsonMalformedRangeLong_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/long' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/long' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"path\": \"/long\"}]}`; @@ -3271,10 +3193,9 @@ it("RestJsonMalformedRangeLong_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/long' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/long' failed to satisfy constraint: Member must be between 2 and 8, inclusive\", \"path\": \"/long\"}]}`; @@ -3309,10 +3230,9 @@ it("RestJsonMalformedRangeMinLong:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/minLong' failed to satisfy constraint: Member must be greater than or equal to 2\", \"fieldList\" : [{\"message\": \"Value at '/minLong' failed to satisfy constraint: Member must be greater than or equal to 2\", \"path\": \"/minLong\"}]}`; @@ -3347,10 +3267,9 @@ it("RestJsonMalformedRangeMaxLong:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/maxLong' failed to satisfy constraint: Member must be less than or equal to 8\", \"fieldList\" : [{\"message\": \"Value at '/maxLong' failed to satisfy constraint: Member must be less than or equal to 8\", \"path\": \"/maxLong\"}]}`; @@ -3385,10 +3304,9 @@ it("RestJsonMalformedRangeByteOverride_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/byte' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/byte' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"path\": \"/byte\"}]}`; @@ -3423,10 +3341,9 @@ it("RestJsonMalformedRangeByteOverride_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/byte' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/byte' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"path\": \"/byte\"}]}`; @@ -3461,10 +3378,9 @@ it("RestJsonMalformedRangeMinByteOverride:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/minByte' failed to satisfy constraint: Member must be greater than or equal to 4\", \"fieldList\" : [{\"message\": \"Value at '/minByte' failed to satisfy constraint: Member must be greater than or equal to 4\", \"path\": \"/minByte\"}]}`; @@ -3499,10 +3415,9 @@ it("RestJsonMalformedRangeMaxByteOverride:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/maxByte' failed to satisfy constraint: Member must be less than or equal to 6\", \"fieldList\" : [{\"message\": \"Value at '/maxByte' failed to satisfy constraint: Member must be less than or equal to 6\", \"path\": \"/maxByte\"}]}`; @@ -3537,10 +3452,9 @@ it("RestJsonMalformedRangeFloatOverride_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/float' failed to satisfy constraint: Member must be between 4.4 and 6.6, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/float' failed to satisfy constraint: Member must be between 4.4 and 6.6, inclusive\", \"path\": \"/float\"}]}`; @@ -3575,10 +3489,9 @@ it("RestJsonMalformedRangeFloatOverride_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/float' failed to satisfy constraint: Member must be between 4.4 and 6.6, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/float' failed to satisfy constraint: Member must be between 4.4 and 6.6, inclusive\", \"path\": \"/float\"}]}`; @@ -3613,10 +3526,9 @@ it("RestJsonMalformedRangeMinFloatOverride:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/minFloat' failed to satisfy constraint: Member must be greater than or equal to 4.4\", \"fieldList\" : [{\"message\": \"Value at '/minFloat' failed to satisfy constraint: Member must be greater than or equal to 4.4\", \"path\": \"/minFloat\"}]}`; @@ -3651,10 +3563,9 @@ it("RestJsonMalformedRangeMaxFloatOverride:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/maxFloat' failed to satisfy constraint: Member must be less than or equal to 6.6\", \"fieldList\" : [{\"message\": \"Value at '/maxFloat' failed to satisfy constraint: Member must be less than or equal to 6.6\", \"path\": \"/maxFloat\"}]}`; @@ -3689,10 +3600,9 @@ it("RestJsonMalformedRangeShortOverride_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/short' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/short' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"path\": \"/short\"}]}`; @@ -3727,10 +3637,9 @@ it("RestJsonMalformedRangeShortOverride_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/short' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/short' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"path\": \"/short\"}]}`; @@ -3765,10 +3674,9 @@ it("RestJsonMalformedRangeMinShortOverride:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/minShort' failed to satisfy constraint: Member must be greater than or equal to 4\", \"fieldList\" : [{\"message\": \"Value at '/minShort' failed to satisfy constraint: Member must be greater than or equal to 4\", \"path\": \"/minShort\"}]}`; @@ -3803,10 +3711,9 @@ it("RestJsonMalformedRangeMaxShortOverride:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/maxShort' failed to satisfy constraint: Member must be less than or equal to 6\", \"fieldList\" : [{\"message\": \"Value at '/maxShort' failed to satisfy constraint: Member must be less than or equal to 6\", \"path\": \"/maxShort\"}]}`; @@ -3841,10 +3748,9 @@ it("RestJsonMalformedRangeIntegerOverride_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/integer' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/integer' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"path\": \"/integer\"}]}`; @@ -3879,10 +3785,9 @@ it("RestJsonMalformedRangeIntegerOverride_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/integer' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/integer' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"path\": \"/integer\"}]}`; @@ -3917,10 +3822,9 @@ it("RestJsonMalformedRangeMinIntegerOverride:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/minInteger' failed to satisfy constraint: Member must be greater than or equal to 4\", \"fieldList\" : [{\"message\": \"Value at '/minInteger' failed to satisfy constraint: Member must be greater than or equal to 4\", \"path\": \"/minInteger\"}]}`; @@ -3955,10 +3859,9 @@ it("RestJsonMalformedRangeMaxIntegerOverride:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/maxInteger' failed to satisfy constraint: Member must be less than or equal to 6\", \"fieldList\" : [{\"message\": \"Value at '/maxInteger' failed to satisfy constraint: Member must be less than or equal to 6\", \"path\": \"/maxInteger\"}]}`; @@ -3993,10 +3896,9 @@ it("RestJsonMalformedRangeLongOverride_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/long' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/long' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"path\": \"/long\"}]}`; @@ -4031,10 +3933,9 @@ it("RestJsonMalformedRangeLongOverride_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/long' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"fieldList\" : [{\"message\": \"Value at '/long' failed to satisfy constraint: Member must be between 4 and 6, inclusive\", \"path\": \"/long\"}]}`; @@ -4069,10 +3970,9 @@ it("RestJsonMalformedRangeMinLongOverride:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/minLong' failed to satisfy constraint: Member must be greater than or equal to 4\", \"fieldList\" : [{\"message\": \"Value at '/minLong' failed to satisfy constraint: Member must be greater than or equal to 4\", \"path\": \"/minLong\"}]}`; @@ -4107,10 +4007,9 @@ it("RestJsonMalformedRangeMaxLongOverride:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/maxLong' failed to satisfy constraint: Member must be less than or equal to 6\", \"fieldList\" : [{\"message\": \"Value at '/maxLong' failed to satisfy constraint: Member must be less than or equal to 6\", \"path\": \"/maxLong\"}]}`; @@ -4148,10 +4047,9 @@ it("RestJsonMalformedRequiredBodyUnset:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/string' failed to satisfy constraint: Member must not be null\", \"fieldList\" : [{\"message\": \"Value at '/string' failed to satisfy constraint: Member must not be null\", \"path\": \"/string\"}]}`; @@ -4189,10 +4087,9 @@ it("RestJsonMalformedRequiredBodyExplicitNull:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/string' failed to satisfy constraint: Member must not be null\", \"fieldList\" : [{\"message\": \"Value at '/string' failed to satisfy constraint: Member must not be null\", \"path\": \"/string\"}]}`; @@ -4229,10 +4126,9 @@ it("RestJsonMalformedRequiredHeaderUnset:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/stringInHeader' failed to satisfy constraint: Member must not be null\", \"fieldList\" : [{\"message\": \"Value at '/stringInHeader' failed to satisfy constraint: Member must not be null\", \"path\": \"/stringInHeader\"}]}`; @@ -4267,10 +4163,9 @@ it("RestJsonMalformedUniqueItemsBlobList:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/blobList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/blobList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/blobList\"}]}`; @@ -4305,10 +4200,9 @@ it("RestJsonMalformedUniqueItemsBooleanList_case0:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/booleanList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/booleanList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/booleanList\"}]}`; @@ -4343,10 +4237,9 @@ it("RestJsonMalformedUniqueItemsBooleanList_case1:MalformedRequest", async () => expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/booleanList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/booleanList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/booleanList\"}]}`; @@ -4381,10 +4274,9 @@ it("RestJsonMalformedUniqueItemsStringList:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/stringList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/stringList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/stringList\"}]}`; @@ -4419,10 +4311,9 @@ it("RestJsonMalformedUniqueItemsByteList:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/byteList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/byteList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/byteList\"}]}`; @@ -4457,10 +4348,9 @@ it("RestJsonMalformedUniqueItemsShortList:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/shortList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/shortList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/shortList\"}]}`; @@ -4495,10 +4385,9 @@ it("RestJsonMalformedUniqueItemsIntegerList:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/integerList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/integerList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/integerList\"}]}`; @@ -4533,10 +4422,9 @@ it("RestJsonMalformedUniqueItemsLongList:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/longList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/longList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/longList\"}]}`; @@ -4571,10 +4459,9 @@ it("RestJsonMalformedUniqueItemsTimestampList:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/timestampList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/timestampList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/timestampList\"}]}`; @@ -4609,10 +4496,9 @@ it("RestJsonMalformedUniqueItemsDateTimeList:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/dateTimeList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/dateTimeList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/dateTimeList\"}]}`; @@ -4647,10 +4533,9 @@ it("RestJsonMalformedUniqueItemsHttpDateList_case0:MalformedRequest", async () = expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/httpDateList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/httpDateList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/httpDateList\"}]}`; @@ -4685,10 +4570,9 @@ it("RestJsonMalformedUniqueItemsEnumList:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/enumList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/enumList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/enumList\"}]}`; @@ -4723,10 +4607,9 @@ it("RestJsonMalformedUniqueItemsIntEnumList:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/intEnumList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/intEnumList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/intEnumList\"}]}`; @@ -4761,10 +4644,9 @@ it("RestJsonMalformedUniqueItemsListList:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/listList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/listList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/listList\"}]}`; @@ -4799,10 +4681,9 @@ it("RestJsonMalformedUniqueItemsStructureList:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/structureList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/structureList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/structureList\"}]}`; @@ -4838,10 +4719,9 @@ it("RestJsonMalformedUniqueItemsStructureMissingKeyList:MalformedRequest", async expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/structureListWithNoKey/0/hi' failed to satisfy constraint: Member must not be null\", \"fieldList\" : [{\"message\": \"Value at '/structureListWithNoKey/0/hi' failed to satisfy constraint: Member must not be null\", \"path\": \"/structureListWithNoKey/0/hi\"}]}`; @@ -4876,10 +4756,9 @@ it("RestJsonMalformedUniqueItemsUnionList_case0:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/unionList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/unionList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/unionList\"}]}`; @@ -4914,10 +4793,9 @@ it("RestJsonMalformedUniqueItemsUnionList_case1:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/unionList' failed to satisfy constraint: Member must have unique values\", \"fieldList\" : [{\"message\": \"Value at '/unionList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/unionList\"}]}`; @@ -4962,7 +4840,10 @@ it("RestJsonRecursiveStructuresValidate:ServerRequest", async () => { }, ][0]; Object.keys(paramsToValidate).forEach((param) => { - expect(r[param]).toBeDefined(); + expect( + r[param], + `The output field ${param} should have been defined in ${JSON.stringify(r, null, 2)}` + ).toBeDefined(); expect(equivalentContents(paramsToValidate[param], r[param])).toBe(true); }); }); @@ -4994,10 +4875,9 @@ it("RestJsonMalformedRecursiveStructures:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/union/union/union/string' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]\", \"fieldList\" : [{\"message\": \"Value at '/union/union/union/string' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]\", \"path\": \"/union/union/union/string\"}]}`; @@ -5032,10 +4912,9 @@ it("RestJsonMalformedPatternSensitiveString:MalformedRequest", async () => { expect(testFunction.mock.calls.length).toBe(0); expect(r.statusCode).toBe(400); - expect(r.headers["x-amzn-errortype"]).toBeDefined(); expect(r.headers["x-amzn-errortype"]).toBe("ValidationException"); - expect(r.body).toBeDefined(); + expect(r.body, `Body was undefined.`).toBeDefined(); const utf8Encoder = __utf8Encoder; const bodyString = `{ \"message\" : \"1 validation error detected. Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"fieldList\" : [{\"message\": \"Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/string\"}]}`; diff --git a/private/aws-restjson-validation-server/vite.config.js b/private/aws-restjson-validation-server/vite.config.js new file mode 100644 index 000000000000..e7147d3ac9e1 --- /dev/null +++ b/private/aws-restjson-validation-server/vite.config.js @@ -0,0 +1,8 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + test: { + include: ["**/*.spec.ts"], + globals: true, + }, +}); diff --git a/scripts/generate-clients/config.js b/scripts/generate-clients/config.js index 3f0e7a6861ff..80ce32c17e2b 100644 --- a/scripts/generate-clients/config.js +++ b/scripts/generate-clients/config.js @@ -1,7 +1,7 @@ // Update this commit when taking up new changes from smithy-typescript. module.exports = { // Use full commit hash as we explicitly fetch it. - SMITHY_TS_COMMIT: "881e4fe5f60b5f1fb2530e6b7b9ba5095d4d6213", + SMITHY_TS_COMMIT: "3db70fad42c143dd53f535089166531836b440e6", }; if (module.exports.SMITHY_TS_COMMIT.length < 40) { diff --git a/yarn.lock b/yarn.lock index 950657b4aa9f..9f62b8f2effd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -282,6 +282,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:~5.2.2" uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" languageName: unknown linkType: soft @@ -334,6 +335,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:~5.2.2" uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" languageName: unknown linkType: soft @@ -386,6 +388,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:~5.2.2" uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" languageName: unknown linkType: soft @@ -438,6 +441,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:~5.2.2" uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" languageName: unknown linkType: soft @@ -490,6 +494,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:~5.2.2" uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" languageName: unknown linkType: soft @@ -542,6 +547,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:~5.2.2" uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" languageName: unknown linkType: soft @@ -596,6 +602,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:~5.2.2" uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" languageName: unknown linkType: soft @@ -654,6 +661,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:~5.2.2" uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" languageName: unknown linkType: soft @@ -711,6 +719,7 @@ __metadata: tslib: "npm:^2.6.2" typescript: "npm:~5.2.2" uuid: "npm:^9.0.1" + vitest: "npm:2.1.8" languageName: unknown linkType: soft @@ -757,6 +766,7 @@ __metadata: rimraf: "npm:3.0.2" tslib: "npm:^2.6.2" typescript: "npm:~5.2.2" + vitest: "npm:2.1.8" languageName: unknown linkType: soft @@ -795,6 +805,7 @@ __metadata: rimraf: "npm:3.0.2" tslib: "npm:^2.6.2" typescript: "npm:~5.2.2" + vitest: "npm:2.1.8" languageName: unknown linkType: soft @@ -833,6 +844,7 @@ __metadata: rimraf: "npm:3.0.2" tslib: "npm:^2.6.2" typescript: "npm:~5.2.2" + vitest: "npm:2.1.8" languageName: unknown linkType: soft @@ -29085,6 +29097,18 @@ __metadata: languageName: node linkType: hard +"@vitest/expect@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/expect@npm:2.1.8" + dependencies: + "@vitest/spy": "npm:2.1.8" + "@vitest/utils": "npm:2.1.8" + chai: "npm:^5.1.2" + tinyrainbow: "npm:^1.2.0" + checksum: 10c0/6fbf4abc2360efe4d3671d3425f8bb6012fe2dd932a88720d8b793030b766ba260494822c721d3fc497afe52373515c7e150635a95c25f6e1b567f86155c5408 + languageName: node + linkType: hard + "@vitest/expect@npm:2.1.9": version: 2.1.9 resolution: "@vitest/expect@npm:2.1.9" @@ -29097,6 +29121,25 @@ __metadata: languageName: node linkType: hard +"@vitest/mocker@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/mocker@npm:2.1.8" + dependencies: + "@vitest/spy": "npm:2.1.8" + estree-walker: "npm:^3.0.3" + magic-string: "npm:^0.30.12" + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + checksum: 10c0/b4113ed8a57c0f60101d02e1b1769357a346ecd55ded499eab384d52106fd4b12d51e9aaa6db98f47de0d56662477be0ed8d46d6dfa84c235f9e1b234709814e + languageName: node + linkType: hard + "@vitest/mocker@npm:2.1.9": version: 2.1.9 resolution: "@vitest/mocker@npm:2.1.9" @@ -29116,7 +29159,16 @@ __metadata: languageName: node linkType: hard -"@vitest/pretty-format@npm:2.1.9, @vitest/pretty-format@npm:^2.1.9": +"@vitest/pretty-format@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/pretty-format@npm:2.1.8" + dependencies: + tinyrainbow: "npm:^1.2.0" + checksum: 10c0/1dc5c9b1c7c7e78e46a2a16033b6b20be05958bbebc5a5b78f29e32718c80252034804fccd23f34db6b3583239db47e68fc5a8e41942c54b8047cc3b4133a052 + languageName: node + linkType: hard + +"@vitest/pretty-format@npm:2.1.9, @vitest/pretty-format@npm:^2.1.8, @vitest/pretty-format@npm:^2.1.9": version: 2.1.9 resolution: "@vitest/pretty-format@npm:2.1.9" dependencies: @@ -29136,6 +29188,16 @@ __metadata: languageName: node linkType: hard +"@vitest/runner@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/runner@npm:2.1.8" + dependencies: + "@vitest/utils": "npm:2.1.8" + pathe: "npm:^1.1.2" + checksum: 10c0/d0826a71494adeafc8c6478257f584d11655145c83e2d8f94c17301d7059c7463ad768a69379e394c50838a7435abcc9255a6b7d8894f5ee06b153e314683a75 + languageName: node + linkType: hard + "@vitest/runner@npm:2.1.9": version: 2.1.9 resolution: "@vitest/runner@npm:2.1.9" @@ -29157,6 +29219,17 @@ __metadata: languageName: node linkType: hard +"@vitest/snapshot@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/snapshot@npm:2.1.8" + dependencies: + "@vitest/pretty-format": "npm:2.1.8" + magic-string: "npm:^0.30.12" + pathe: "npm:^1.1.2" + checksum: 10c0/8d7a77a52e128630ea737ee0a0fe746d1d325cac5848326861dbf042844da4d5c1a5145539ae0ed1a3f0b0363506e98d86f2679fadf114ec4b987f1eb616867b + languageName: node + linkType: hard + "@vitest/snapshot@npm:2.1.9": version: 2.1.9 resolution: "@vitest/snapshot@npm:2.1.9" @@ -29177,6 +29250,15 @@ __metadata: languageName: node linkType: hard +"@vitest/spy@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/spy@npm:2.1.8" + dependencies: + tinyspy: "npm:^3.0.2" + checksum: 10c0/9740f10772ede004ea7f9ffb8a6c3011341d75d9d7f2d4d181b123a701c4691e942f38cf1700684a3bb5eea3c78addf753fd8cdf78c51d8eadc3bada6fadf8f2 + languageName: node + linkType: hard + "@vitest/spy@npm:2.1.9": version: 2.1.9 resolution: "@vitest/spy@npm:2.1.9" @@ -29197,6 +29279,17 @@ __metadata: languageName: node linkType: hard +"@vitest/utils@npm:2.1.8": + version: 2.1.8 + resolution: "@vitest/utils@npm:2.1.8" + dependencies: + "@vitest/pretty-format": "npm:2.1.8" + loupe: "npm:^3.1.2" + tinyrainbow: "npm:^1.2.0" + checksum: 10c0/d4a29ecd8f6c24c790e4c009f313a044d89e664e331bc9c3cfb57fe1380fb1d2999706dbbfc291f067d6c489602e76d00435309fbc906197c0d01f831ca17d64 + languageName: node + linkType: hard + "@vitest/utils@npm:2.1.9": version: 2.1.9 resolution: "@vitest/utils@npm:2.1.9" @@ -40909,6 +41002,21 @@ __metadata: languageName: node linkType: hard +"vite-node@npm:2.1.8": + version: 2.1.8 + resolution: "vite-node@npm:2.1.8" + dependencies: + cac: "npm:^6.7.14" + debug: "npm:^4.3.7" + es-module-lexer: "npm:^1.5.4" + pathe: "npm:^1.1.2" + vite: "npm:^5.0.0" + bin: + vite-node: vite-node.mjs + checksum: 10c0/cb28027a7425ba29780e216164c07d36a4ff9eb60d83afcad3bc222fd5a5f3e36030071c819edd6d910940f502d49e52f7564743617bc1c5875485b0952c72d5 + languageName: node + linkType: hard + "vite-node@npm:2.1.9": version: 2.1.9 resolution: "vite-node@npm:2.1.9" @@ -41019,6 +41127,56 @@ __metadata: languageName: node linkType: hard +"vitest@npm:2.1.8": + version: 2.1.8 + resolution: "vitest@npm:2.1.8" + dependencies: + "@vitest/expect": "npm:2.1.8" + "@vitest/mocker": "npm:2.1.8" + "@vitest/pretty-format": "npm:^2.1.8" + "@vitest/runner": "npm:2.1.8" + "@vitest/snapshot": "npm:2.1.8" + "@vitest/spy": "npm:2.1.8" + "@vitest/utils": "npm:2.1.8" + chai: "npm:^5.1.2" + debug: "npm:^4.3.7" + expect-type: "npm:^1.1.0" + magic-string: "npm:^0.30.12" + pathe: "npm:^1.1.2" + std-env: "npm:^3.8.0" + tinybench: "npm:^2.9.0" + tinyexec: "npm:^0.3.1" + tinypool: "npm:^1.0.1" + tinyrainbow: "npm:^1.2.0" + vite: "npm:^5.0.0" + vite-node: "npm:2.1.8" + why-is-node-running: "npm:^2.3.0" + peerDependencies: + "@edge-runtime/vm": "*" + "@types/node": ^18.0.0 || >=20.0.0 + "@vitest/browser": 2.1.8 + "@vitest/ui": 2.1.8 + happy-dom: "*" + jsdom: "*" + peerDependenciesMeta: + "@edge-runtime/vm": + optional: true + "@types/node": + optional: true + "@vitest/browser": + optional: true + "@vitest/ui": + optional: true + happy-dom: + optional: true + jsdom: + optional: true + bin: + vitest: vitest.mjs + checksum: 10c0/e70631bad5662d6c60c5cf836a4baf58b890db6654fef1f608fe6a86aa49a2b9f078aac74b719d4d3c87c5c781968cc73590a7935277b48f3d8b6fb9c5b4d276 + languageName: node + linkType: hard + "vitest@npm:2.1.9": version: 2.1.9 resolution: "vitest@npm:2.1.9" From 1e2584c388af23067d6a4a84876374b0d5afa8b1 Mon Sep 17 00:00:00 2001 From: George Fu Date: Wed, 30 Apr 2025 16:52:24 -0400 Subject: [PATCH 3/3] test: replaced non-codegen vitest.config files --- private/aws-protocoltests-ec2/vitest.config.js | 10 ---------- private/aws-protocoltests-json-10/vitest.config.js | 10 ---------- .../vitest.config.js | 10 ---------- private/aws-protocoltests-json/vitest.config.js | 10 ---------- private/aws-protocoltests-query/vitest.config.js | 10 ---------- .../vitest.config.js | 10 ---------- .../vitest.config.js | 10 ---------- private/aws-protocoltests-restjson/vitest.config.js | 10 ---------- private/aws-protocoltests-restxml/vitest.config.js | 10 ---------- .../vitest.config.js | 10 ---------- private/aws-restjson-server/vitest.config.js | 10 ---------- .../aws-restjson-validation-server/vitest.config.js | 10 ---------- 12 files changed, 120 deletions(-) delete mode 100644 private/aws-protocoltests-ec2/vitest.config.js delete mode 100644 private/aws-protocoltests-json-10/vitest.config.js delete mode 100644 private/aws-protocoltests-json-machinelearning/vitest.config.js delete mode 100644 private/aws-protocoltests-json/vitest.config.js delete mode 100644 private/aws-protocoltests-query/vitest.config.js delete mode 100644 private/aws-protocoltests-restjson-apigateway/vitest.config.js delete mode 100644 private/aws-protocoltests-restjson-glacier/vitest.config.js delete mode 100644 private/aws-protocoltests-restjson/vitest.config.js delete mode 100644 private/aws-protocoltests-restxml/vitest.config.js delete mode 100644 private/aws-protocoltests-smithy-rpcv2-cbor/vitest.config.js delete mode 100644 private/aws-restjson-server/vitest.config.js delete mode 100644 private/aws-restjson-validation-server/vitest.config.js diff --git a/private/aws-protocoltests-ec2/vitest.config.js b/private/aws-protocoltests-ec2/vitest.config.js deleted file mode 100644 index ff6aa0c5d1dc..000000000000 --- a/private/aws-protocoltests-ec2/vitest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - exclude: ["**/*.{integ,e2e,browser}.spec.ts"], - include: ["**/*.spec.ts"], - environment: "node", - globals: true, - }, -}); diff --git a/private/aws-protocoltests-json-10/vitest.config.js b/private/aws-protocoltests-json-10/vitest.config.js deleted file mode 100644 index ff6aa0c5d1dc..000000000000 --- a/private/aws-protocoltests-json-10/vitest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - exclude: ["**/*.{integ,e2e,browser}.spec.ts"], - include: ["**/*.spec.ts"], - environment: "node", - globals: true, - }, -}); diff --git a/private/aws-protocoltests-json-machinelearning/vitest.config.js b/private/aws-protocoltests-json-machinelearning/vitest.config.js deleted file mode 100644 index ff6aa0c5d1dc..000000000000 --- a/private/aws-protocoltests-json-machinelearning/vitest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - exclude: ["**/*.{integ,e2e,browser}.spec.ts"], - include: ["**/*.spec.ts"], - environment: "node", - globals: true, - }, -}); diff --git a/private/aws-protocoltests-json/vitest.config.js b/private/aws-protocoltests-json/vitest.config.js deleted file mode 100644 index ff6aa0c5d1dc..000000000000 --- a/private/aws-protocoltests-json/vitest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - exclude: ["**/*.{integ,e2e,browser}.spec.ts"], - include: ["**/*.spec.ts"], - environment: "node", - globals: true, - }, -}); diff --git a/private/aws-protocoltests-query/vitest.config.js b/private/aws-protocoltests-query/vitest.config.js deleted file mode 100644 index ff6aa0c5d1dc..000000000000 --- a/private/aws-protocoltests-query/vitest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - exclude: ["**/*.{integ,e2e,browser}.spec.ts"], - include: ["**/*.spec.ts"], - environment: "node", - globals: true, - }, -}); diff --git a/private/aws-protocoltests-restjson-apigateway/vitest.config.js b/private/aws-protocoltests-restjson-apigateway/vitest.config.js deleted file mode 100644 index ff6aa0c5d1dc..000000000000 --- a/private/aws-protocoltests-restjson-apigateway/vitest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - exclude: ["**/*.{integ,e2e,browser}.spec.ts"], - include: ["**/*.spec.ts"], - environment: "node", - globals: true, - }, -}); diff --git a/private/aws-protocoltests-restjson-glacier/vitest.config.js b/private/aws-protocoltests-restjson-glacier/vitest.config.js deleted file mode 100644 index ff6aa0c5d1dc..000000000000 --- a/private/aws-protocoltests-restjson-glacier/vitest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - exclude: ["**/*.{integ,e2e,browser}.spec.ts"], - include: ["**/*.spec.ts"], - environment: "node", - globals: true, - }, -}); diff --git a/private/aws-protocoltests-restjson/vitest.config.js b/private/aws-protocoltests-restjson/vitest.config.js deleted file mode 100644 index ff6aa0c5d1dc..000000000000 --- a/private/aws-protocoltests-restjson/vitest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - exclude: ["**/*.{integ,e2e,browser}.spec.ts"], - include: ["**/*.spec.ts"], - environment: "node", - globals: true, - }, -}); diff --git a/private/aws-protocoltests-restxml/vitest.config.js b/private/aws-protocoltests-restxml/vitest.config.js deleted file mode 100644 index ff6aa0c5d1dc..000000000000 --- a/private/aws-protocoltests-restxml/vitest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - exclude: ["**/*.{integ,e2e,browser}.spec.ts"], - include: ["**/*.spec.ts"], - environment: "node", - globals: true, - }, -}); diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor/vitest.config.js b/private/aws-protocoltests-smithy-rpcv2-cbor/vitest.config.js deleted file mode 100644 index ff6aa0c5d1dc..000000000000 --- a/private/aws-protocoltests-smithy-rpcv2-cbor/vitest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - exclude: ["**/*.{integ,e2e,browser}.spec.ts"], - include: ["**/*.spec.ts"], - environment: "node", - globals: true, - }, -}); diff --git a/private/aws-restjson-server/vitest.config.js b/private/aws-restjson-server/vitest.config.js deleted file mode 100644 index ff6aa0c5d1dc..000000000000 --- a/private/aws-restjson-server/vitest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - exclude: ["**/*.{integ,e2e,browser}.spec.ts"], - include: ["**/*.spec.ts"], - environment: "node", - globals: true, - }, -}); diff --git a/private/aws-restjson-validation-server/vitest.config.js b/private/aws-restjson-validation-server/vitest.config.js deleted file mode 100644 index ff6aa0c5d1dc..000000000000 --- a/private/aws-restjson-validation-server/vitest.config.js +++ /dev/null @@ -1,10 +0,0 @@ -import { defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - exclude: ["**/*.{integ,e2e,browser}.spec.ts"], - include: ["**/*.spec.ts"], - environment: "node", - globals: true, - }, -});