diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java index c4c9eec9cc0dc..12a86e8c65015 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AwsProtocolUtils.java @@ -305,44 +305,17 @@ private static boolean filterProtocolTests( HttpMessageTestCase testCase, TypeScriptSettings settings ) { - // TODO: Remove when requestCompression has been implemented. - if (testCase.getId().startsWith("SDKAppliedContentEncoding_") - || testCase.getId().startsWith("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_") - || testCase.getId().startsWith("SDKAppendedGzipAfterProvidedEncoding_")) { - return true; - } - // TODO: Remove when upstream tests update to serialize empty headers. if (testCase.getId().contains("NullAndEmptyHeaders")) { return true; } - if (testCase.getTags().contains("defaults")) { - return true; - } - - // TODO: remove when there's a decision on separator to use - // https://github.com/awslabs/smithy/issues/1014 - if (testCase.getId().equals("RestJsonInputAndOutputWithQuotedStringHeaders")) { - return true; - } - - // TODO: implementation change pending. - List extraUnionKey = Arrays.asList( - "RestXmlHttpPayloadWithUnsetUnion", - "RestJsonHttpPayloadWithUnsetUnion" - ); - if (extraUnionKey.contains(testCase.getId())) { - return true; - } - // TODO: remove when Glacier AccountID hyphen customization is implemented: SMITHY-2614 if (testCase.getId().equals("GlacierAccountId")) { return true; } - // ToDo: https://github.com/aws/aws-sdk-js-v3/issues/6246 - if (testCase.getId().equals("RestJsonMustSupportParametersInContentType")) { + if (testCase.getTags().contains("defaults")) { return true; } diff --git a/private/aws-protocoltests-ec2/test/functional/ec2query.spec.ts b/private/aws-protocoltests-ec2/test/functional/ec2query.spec.ts index 99e8e415705f6..74ec6870cb556 100644 --- a/private/aws-protocoltests-ec2/test/functional/ec2query.spec.ts +++ b/private/aws-protocoltests-ec2/test/functional/ec2query.spec.ts @@ -835,7 +835,7 @@ it("Ec2QueryNoInputAndOutput:Response", async () => { /** * Compression algorithm encoding is appended to the Content-Encoding header. */ -it.skip("SDKAppliedContentEncoding_ec2Query:Request", async () => { +it("SDKAppliedContentEncoding_ec2Query:Request", async () => { const client = new EC2ProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), @@ -868,7 +868,7 @@ it.skip("SDKAppliedContentEncoding_ec2Query:Request", async () => { * traits are ignored in the ec2Query protocol. * */ -it.skip("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_ec2Query:Request", async () => { +it("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_ec2Query:Request", async () => { const client = new EC2ProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), 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 029b8bccf6955..a868bb62a1398 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 @@ -2751,7 +2751,7 @@ it.skip("AwsJson10ClientErrorCorrectsWhenServerFailsToSerializeRequiredValues:Re /** * Compression algorithm encoding is appended to the Content-Encoding header. */ -it.skip("SDKAppliedContentEncoding_awsJson1_0:Request", async () => { +it("SDKAppliedContentEncoding_awsJson1_0:Request", async () => { const client = new JSONRPC10Client({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), @@ -2784,7 +2784,7 @@ it.skip("SDKAppliedContentEncoding_awsJson1_0:Request", async () => { * traits are ignored in the awsJson1_0 protocol. * */ -it.skip("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_0:Request", async () => { +it("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_0:Request", async () => { const client = new JSONRPC10Client({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), 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 4b026aaa6af3e..d34e81ffd364d 100644 --- a/private/aws-protocoltests-json/test/functional/awsjson1_1.spec.ts +++ b/private/aws-protocoltests-json/test/functional/awsjson1_1.spec.ts @@ -4410,7 +4410,7 @@ it("PutAndGetInlineDocumentsInput:Response", async () => { /** * Compression algorithm encoding is appended to the Content-Encoding header. */ -it.skip("SDKAppliedContentEncoding_awsJson1_1:Request", async () => { +it("SDKAppliedContentEncoding_awsJson1_1:Request", async () => { const client = new JsonProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), @@ -4443,7 +4443,7 @@ it.skip("SDKAppliedContentEncoding_awsJson1_1:Request", async () => { * traits are ignored in the awsJson1_1 protocol. * */ -it.skip("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_1:Request", async () => { +it("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsJson1_1:Request", async () => { const client = new JsonProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), diff --git a/private/aws-protocoltests-query/test/functional/awsquery.spec.ts b/private/aws-protocoltests-query/test/functional/awsquery.spec.ts index f9d762e525dc5..b7c25a4c73211 100644 --- a/private/aws-protocoltests-query/test/functional/awsquery.spec.ts +++ b/private/aws-protocoltests-query/test/functional/awsquery.spec.ts @@ -1088,7 +1088,7 @@ it("QueryNoInputAndOutput:Response", async () => { /** * Compression algorithm encoding is appended to the Content-Encoding header. */ -it.skip("SDKAppliedContentEncoding_awsQuery:Request", async () => { +it("SDKAppliedContentEncoding_awsQuery:Request", async () => { const client = new QueryProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), @@ -1121,7 +1121,7 @@ it.skip("SDKAppliedContentEncoding_awsQuery:Request", async () => { * traits are ignored in the awsQuery protocol. * */ -it.skip("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsQuery:Request", async () => { +it("SDKAppendsGzipAndIgnoresHttpProvidedEncoding_awsQuery:Request", async () => { const client = new QueryProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), diff --git a/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts b/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts index 57b6c3b36315a..f05a1a5f0fabf 100644 --- a/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts +++ b/private/aws-protocoltests-restjson/test/functional/restjson1.spec.ts @@ -2695,7 +2695,7 @@ it("RestJsonHttpPayloadWithUnion:Request", async () => { /** * No payload is sent if the union has no value. */ -it.skip("RestJsonHttpPayloadWithUnsetUnion:Request", async () => { +it("RestJsonHttpPayloadWithUnsetUnion:Request", async () => { const client = new RestJsonProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), @@ -2764,7 +2764,7 @@ it("RestJsonHttpPayloadWithUnion:Response", async () => { /** * No payload is sent if the union has no value. */ -it.skip("RestJsonHttpPayloadWithUnsetUnion:Response", async () => { +it("RestJsonHttpPayloadWithUnsetUnion:Response", async () => { const client = new RestJsonProtocolClient({ ...clientParams, requestHandler: new ResponseDeserializationTestHandler( @@ -3440,7 +3440,7 @@ it("RestJsonInputAndOutputWithStringHeaders:Request", async () => { /** * Tests requests with string list header bindings that require quoting */ -it.skip("RestJsonInputAndOutputWithQuotedStringHeaders:Request", async () => { +it("RestJsonInputAndOutputWithQuotedStringHeaders:Request", async () => { const client = new RestJsonProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), @@ -3804,7 +3804,7 @@ it("RestJsonInputAndOutputWithStringHeaders:Response", async () => { /** * Tests responses with string list header bindings that require quoting */ -it.skip("RestJsonInputAndOutputWithQuotedStringHeaders:Response", async () => { +it("RestJsonInputAndOutputWithQuotedStringHeaders:Response", async () => { const client = new RestJsonProtocolClient({ ...clientParams, requestHandler: new ResponseDeserializationTestHandler(true, 200, { @@ -7853,7 +7853,7 @@ it("PostUnionWithJsonNameResponse3:Response", async () => { /** * Compression algorithm encoding is appended to the Content-Encoding header. */ -it.skip("SDKAppliedContentEncoding_restJson1:Request", async () => { +it("SDKAppliedContentEncoding_restJson1:Request", async () => { const client = new RestJsonProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), @@ -7886,7 +7886,7 @@ it.skip("SDKAppliedContentEncoding_restJson1:Request", async () => { * request compression encoding from the HTTP binding. * */ -it.skip("SDKAppendedGzipAfterProvidedEncoding_restJson1:Request", async () => { +it("SDKAppendedGzipAfterProvidedEncoding_restJson1:Request", async () => { const client = new RestJsonProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), @@ -7910,7 +7910,7 @@ it.skip("SDKAppendedGzipAfterProvidedEncoding_restJson1:Request", async () => { expect(r.path).toBe("/requestcompression/putcontentwithencoding"); expect(r.headers["content-encoding"]).toBeDefined(); - expect(r.headers["content-encoding"]).toBe("custom, gzip"); + expect(r.headers["content-encoding"].replaceAll(", ", ",")).toBe("custom, gzip".replaceAll(", ", ",")); } }); diff --git a/private/aws-protocoltests-restxml/test/functional/restxml.spec.ts b/private/aws-protocoltests-restxml/test/functional/restxml.spec.ts index e18f9ad96d5e9..88578f44cd7a5 100644 --- a/private/aws-protocoltests-restxml/test/functional/restxml.spec.ts +++ b/private/aws-protocoltests-restxml/test/functional/restxml.spec.ts @@ -1923,7 +1923,7 @@ it("RestXmlHttpPayloadWithUnion:Request", async () => { /** * No payload is sent if the union has no value. */ -it.skip("RestXmlHttpPayloadWithUnsetUnion:Request", async () => { +it("RestXmlHttpPayloadWithUnsetUnion:Request", async () => { const client = new RestXmlProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), @@ -1992,7 +1992,7 @@ it("RestXmlHttpPayloadWithUnion:Response", async () => { /** * No payload is sent if the union has no value. */ -it.skip("RestXmlHttpPayloadWithUnsetUnion:Response", async () => { +it("RestXmlHttpPayloadWithUnsetUnion:Response", async () => { const client = new RestXmlProtocolClient({ ...clientParams, requestHandler: new ResponseDeserializationTestHandler( @@ -3831,7 +3831,7 @@ it("RestXmlSerializesEmptyString:Request", async () => { /** * Compression algorithm encoding is appended to the Content-Encoding header. */ -it.skip("SDKAppliedContentEncoding_restXml:Request", async () => { +it("SDKAppliedContentEncoding_restXml:Request", async () => { const client = new RestXmlProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), @@ -3864,7 +3864,7 @@ it.skip("SDKAppliedContentEncoding_restXml:Request", async () => { * request compression encoding from the HTTP binding. * */ -it.skip("SDKAppendedGzipAfterProvidedEncoding_restXml:Request", async () => { +it("SDKAppendedGzipAfterProvidedEncoding_restXml:Request", async () => { const client = new RestXmlProtocolClient({ ...clientParams, requestHandler: new RequestSerializationTestHandler(), @@ -3888,7 +3888,7 @@ it.skip("SDKAppendedGzipAfterProvidedEncoding_restXml:Request", async () => { expect(r.path).toBe("/requestcompression/putcontentwithencoding"); expect(r.headers["content-encoding"]).toBeDefined(); - expect(r.headers["content-encoding"]).toBe("custom, gzip"); + expect(r.headers["content-encoding"].replaceAll(", ", ",")).toBe("custom, gzip".replaceAll(", ", ",")); } }); diff --git a/private/aws-restjson-server/test/functional/restjson1.spec.ts b/private/aws-restjson-server/test/functional/restjson1.spec.ts index 27611325738e0..c16429f07ec80 100644 --- a/private/aws-restjson-server/test/functional/restjson1.spec.ts +++ b/private/aws-restjson-server/test/functional/restjson1.spec.ts @@ -972,7 +972,7 @@ it("RestJsonConstantQueryString:ServerRequest", async () => { /** * A server should ignore parameters added to the content type */ -it.skip("RestJsonMustSupportParametersInContentType:ServerRequest", async () => { +it("RestJsonMustSupportParametersInContentType:ServerRequest", async () => { const testFunction = jest.fn(); testFunction.mockReturnValue(Promise.resolve({})); const testService: Partial> = { @@ -3089,7 +3089,7 @@ it("RestJsonHttpPayloadWithUnion:ServerRequest", async () => { /** * No payload is sent if the union has no value. */ -it.skip("RestJsonHttpPayloadWithUnsetUnion:ServerRequest", async () => { +it("RestJsonHttpPayloadWithUnsetUnion:ServerRequest", async () => { const testFunction = jest.fn(); testFunction.mockReturnValue(Promise.resolve({})); const testService: Partial> = { @@ -3181,7 +3181,7 @@ it("RestJsonHttpPayloadWithUnion:ServerResponse", async () => { /** * No payload is sent if the union has no value. */ -it.skip("RestJsonHttpPayloadWithUnsetUnion:ServerResponse", async () => { +it("RestJsonHttpPayloadWithUnsetUnion:ServerResponse", async () => { class TestService implements Partial> { HttpPayloadWithUnion(input: any, ctx: {}): Promise { const response = {} as any; @@ -4183,7 +4183,7 @@ it("RestJsonInputAndOutputWithStringHeaders:ServerRequest", async () => { /** * Tests requests with string list header bindings that require quoting */ -it.skip("RestJsonInputAndOutputWithQuotedStringHeaders:ServerRequest", async () => { +it("RestJsonInputAndOutputWithQuotedStringHeaders:ServerRequest", async () => { const testFunction = jest.fn(); testFunction.mockReturnValue(Promise.resolve({})); const testService: Partial> = { @@ -4661,7 +4661,7 @@ it("RestJsonInputAndOutputWithStringHeaders:ServerResponse", async () => { /** * Tests responses with string list header bindings that require quoting */ -it.skip("RestJsonInputAndOutputWithQuotedStringHeaders:ServerResponse", async () => { +it("RestJsonInputAndOutputWithQuotedStringHeaders:ServerResponse", async () => { class TestService implements Partial> { InputAndOutputWithHeaders(input: any, ctx: {}): Promise { const response = { @@ -28798,7 +28798,7 @@ it("PostUnionWithJsonNameResponse3:ServerResponse", async () => { /** * Compression algorithm encoding is appended to the Content-Encoding header. */ -it.skip("SDKAppliedContentEncoding_restJson1:ServerRequest", async () => { +it("SDKAppliedContentEncoding_restJson1:ServerRequest", async () => { const testFunction = jest.fn(); testFunction.mockReturnValue(Promise.resolve({})); const testService: Partial> = { @@ -28844,7 +28844,7 @@ it.skip("SDKAppliedContentEncoding_restJson1:ServerRequest", async () => { * request compression encoding from the HTTP binding. * */ -it.skip("SDKAppendedGzipAfterProvidedEncoding_restJson1:ServerRequest", async () => { +it("SDKAppendedGzipAfterProvidedEncoding_restJson1:ServerRequest", async () => { const testFunction = jest.fn(); testFunction.mockReturnValue(Promise.resolve({})); const testService: Partial> = {