@@ -2957,6 +2957,38 @@ it("RestJsonInputAndOutputWithStringHeaders:Request", async () => {
2957
2957
}
2958
2958
} ) ;
2959
2959
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
+
2960
2992
/**
2961
2993
* Tests requests with numeric header bindings
2962
2994
*/
@@ -3062,7 +3094,7 @@ it("RestJsonInputAndOutputWithBooleanHeaders:Request", async () => {
3062
3094
/**
3063
3095
* Tests requests with timestamp header bindings
3064
3096
*/
3065
- it ( "RestJsonInputAndOutputWithTimestampHeaders:Request" , async ( ) => {
3097
+ it . skip ( "RestJsonInputAndOutputWithTimestampHeaders:Request" , async ( ) => {
3066
3098
const client = new RestJsonProtocolClient ( {
3067
3099
...clientParams ,
3068
3100
requestHandler : new RequestSerializationTestHandler ( ) ,
@@ -3085,7 +3117,7 @@ it("RestJsonInputAndOutputWithTimestampHeaders:Request", async () => {
3085
3117
expect ( r . path ) . toBe ( "/InputAndOutputWithHeaders" ) ;
3086
3118
3087
3119
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"' ) ;
3089
3121
3090
3122
expect ( r . body ) . toBeFalsy ( ) ;
3091
3123
}
@@ -3274,6 +3306,39 @@ it("RestJsonInputAndOutputWithStringHeaders:Response", async () => {
3274
3306
} ) ;
3275
3307
} ) ;
3276
3308
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
+
3277
3342
/**
3278
3343
* Tests responses with numeric header bindings
3279
3344
*/
@@ -3373,11 +3438,11 @@ it("RestJsonInputAndOutputWithBooleanHeaders:Response", async () => {
3373
3438
/**
3374
3439
* Tests responses with timestamp header bindings
3375
3440
*/
3376
- it ( "RestJsonInputAndOutputWithTimestampHeaders:Response" , async ( ) => {
3441
+ it . skip ( "RestJsonInputAndOutputWithTimestampHeaders:Response" , async ( ) => {
3377
3442
const client = new RestJsonProtocolClient ( {
3378
3443
...clientParams ,
3379
3444
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"' ,
3381
3446
} ) ,
3382
3447
} ) ;
3383
3448
@@ -7722,8 +7787,6 @@ it.skip("RestJsonTestPayloadStructure:Request", async () => {
7722
7787
} ) ;
7723
7788
7724
7789
const command = new TestPayloadStructureCommand ( {
7725
- testId : "t-12345" ,
7726
-
7727
7790
payloadConfig : {
7728
7791
data : 25 ,
7729
7792
} as any ,
@@ -7782,6 +7845,8 @@ it.skip("RestJsonHttpWithHeadersButNoPayload:Request", async () => {
7782
7845
7783
7846
expect ( r . headers [ "content-type" ] ) . toBeDefined ( ) ;
7784
7847
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" ) ;
7785
7850
7786
7851
expect ( r . body ) . toBeDefined ( ) ;
7787
7852
const utf8Encoder = client . config . utf8Encoder ;
0 commit comments