@@ -2957,6 +2957,38 @@ it("RestJsonInputAndOutputWithStringHeaders:Request", async () => {
29572957 }
29582958} ) ;
29592959
2960+ /**
2961+ * Tests requests with string list header bindings that require quoting
2962+ */
2963+ it . skip ( "RestJsonInputAndOutputWithQuotedStringHeaders:Request" , async ( ) => {
2964+ const client = new RestJsonProtocolClient ( {
2965+ ...clientParams ,
2966+ requestHandler : new RequestSerializationTestHandler ( ) ,
2967+ } ) ;
2968+
2969+ const command = new InputAndOutputWithHeadersCommand ( {
2970+ headerStringList : [ "b,c" , '"def"' , "a" ] ,
2971+ } as any ) ;
2972+ try {
2973+ await client . send ( command ) ;
2974+ fail ( "Expected an EXPECTED_REQUEST_SERIALIZATION_ERROR to be thrown" ) ;
2975+ return ;
2976+ } catch ( err ) {
2977+ if ( ! ( err instanceof EXPECTED_REQUEST_SERIALIZATION_ERROR ) ) {
2978+ fail ( err ) ;
2979+ return ;
2980+ }
2981+ const r = err . request ;
2982+ expect ( r . method ) . toBe ( "POST" ) ;
2983+ expect ( r . path ) . toBe ( "/InputAndOutputWithHeaders" ) ;
2984+
2985+ expect ( r . headers [ "x-stringlist" ] ) . toBeDefined ( ) ;
2986+ expect ( r . headers [ "x-stringlist" ] ) . toBe ( '"b,c",""def"",a' ) ;
2987+
2988+ expect ( r . body ) . toBeFalsy ( ) ;
2989+ }
2990+ } ) ;
2991+
29602992/**
29612993 * Tests requests with numeric header bindings
29622994 */
@@ -3062,7 +3094,7 @@ it("RestJsonInputAndOutputWithBooleanHeaders:Request", async () => {
30623094/**
30633095 * Tests requests with timestamp header bindings
30643096 */
3065- it ( "RestJsonInputAndOutputWithTimestampHeaders:Request" , async ( ) => {
3097+ it . skip ( "RestJsonInputAndOutputWithTimestampHeaders:Request" , async ( ) => {
30663098 const client = new RestJsonProtocolClient ( {
30673099 ...clientParams ,
30683100 requestHandler : new RequestSerializationTestHandler ( ) ,
@@ -3085,7 +3117,7 @@ it("RestJsonInputAndOutputWithTimestampHeaders:Request", async () => {
30853117 expect ( r . path ) . toBe ( "/InputAndOutputWithHeaders" ) ;
30863118
30873119 expect ( r . headers [ "x-timestamplist" ] ) . toBeDefined ( ) ;
3088- expect ( r . headers [ "x-timestamplist" ] ) . toBe ( "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT" ) ;
3120+ expect ( r . headers [ "x-timestamplist" ] ) . toBe ( ' "Mon, 16 Dec 2019 23:48:18 GMT", " Mon, 16 Dec 2019 23:48:18 GMT"' ) ;
30893121
30903122 expect ( r . body ) . toBeFalsy ( ) ;
30913123 }
@@ -3274,6 +3306,39 @@ it("RestJsonInputAndOutputWithStringHeaders:Response", async () => {
32743306 } ) ;
32753307} ) ;
32763308
3309+ /**
3310+ * Tests responses with string list header bindings that require quoting
3311+ */
3312+ it . skip ( "RestJsonInputAndOutputWithQuotedStringHeaders:Response" , async ( ) => {
3313+ const client = new RestJsonProtocolClient ( {
3314+ ...clientParams ,
3315+ requestHandler : new ResponseDeserializationTestHandler ( true , 200 , {
3316+ "x-stringlist" : '"b,c",""def"",a' ,
3317+ } ) ,
3318+ } ) ;
3319+
3320+ const params : any = { } ;
3321+ const command = new InputAndOutputWithHeadersCommand ( params ) ;
3322+
3323+ let r : any ;
3324+ try {
3325+ r = await client . send ( command ) ;
3326+ } catch ( err ) {
3327+ fail ( "Expected a valid response to be returned, got err." ) ;
3328+ return ;
3329+ }
3330+ expect ( r [ "$metadata" ] . httpStatusCode ) . toBe ( 200 ) ;
3331+ const paramsToValidate : any = [
3332+ {
3333+ headerStringList : [ "a" , "b,c" , '"def"' ] ,
3334+ } ,
3335+ ] [ 0 ] ;
3336+ Object . keys ( paramsToValidate ) . forEach ( ( param ) => {
3337+ expect ( r [ param ] ) . toBeDefined ( ) ;
3338+ expect ( equivalentContents ( r [ param ] , paramsToValidate [ param ] ) ) . toBe ( true ) ;
3339+ } ) ;
3340+ } ) ;
3341+
32773342/**
32783343 * Tests responses with numeric header bindings
32793344 */
@@ -3373,11 +3438,11 @@ it("RestJsonInputAndOutputWithBooleanHeaders:Response", async () => {
33733438/**
33743439 * Tests responses with timestamp header bindings
33753440 */
3376- it ( "RestJsonInputAndOutputWithTimestampHeaders:Response" , async ( ) => {
3441+ it . skip ( "RestJsonInputAndOutputWithTimestampHeaders:Response" , async ( ) => {
33773442 const client = new RestJsonProtocolClient ( {
33783443 ...clientParams ,
33793444 requestHandler : new ResponseDeserializationTestHandler ( true , 200 , {
3380- "x-timestamplist" : "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT" ,
3445+ "x-timestamplist" : ' "Mon, 16 Dec 2019 23:48:18 GMT", " Mon, 16 Dec 2019 23:48:18 GMT"' ,
33813446 } ) ,
33823447 } ) ;
33833448
@@ -7722,8 +7787,6 @@ it.skip("RestJsonTestPayloadStructure:Request", async () => {
77227787 } ) ;
77237788
77247789 const command = new TestPayloadStructureCommand ( {
7725- testId : "t-12345" ,
7726-
77277790 payloadConfig : {
77287791 data : 25 ,
77297792 } as any ,
@@ -7782,6 +7845,8 @@ it.skip("RestJsonHttpWithHeadersButNoPayload:Request", async () => {
77827845
77837846 expect ( r . headers [ "content-type" ] ) . toBeDefined ( ) ;
77847847 expect ( r . headers [ "content-type" ] ) . toBe ( "application/json" ) ;
7848+ expect ( r . headers [ "x-amz-test-id" ] ) . toBeDefined ( ) ;
7849+ expect ( r . headers [ "x-amz-test-id" ] ) . toBe ( "t-12345" ) ;
77857850
77867851 expect ( r . body ) . toBeDefined ( ) ;
77877852 const utf8Encoder = client . config . utf8Encoder ;
0 commit comments