1+ $ version : " 1.0"
2+
3+ namespace com.amazonaws.s3
4+ use smithy.test#httpResponseTests
5+ use smithy.test#httpRequestTests
6+
7+ apply NotFound @httpResponseTests ([
8+ {
9+ id : " HeadObjectEmptyBody" ,
10+ documentation : " This test case validates https://github.com/awslabs/aws-sdk-swift/issues/183" ,
11+ params : {
12+ },
13+ body : " " ,
14+ protocol : " aws.protocols#restXml" ,
15+ code : 404 ,
16+ headers : {
17+ "x-amz-request-id" : " GRZ6BZ468DF52F2E" ,
18+ "x-amz-id-2" : " UTniwu6QmCIjVeuK2ZfeWBOnu7SqMQOS3Vac6B/K4H2ZCawYUl+nDbhGTImuyhZ5DFiojR3Kcz4=" ,
19+ "content-type" : " application/xml" ,
20+ "date" : " Thu, 03 Jun 2021 04:05:52 GMT" ,
21+ "server" : " AmazonS3"
22+ }
23+ }
24+ ])
25+
26+ // FIXME - when we implement virtual host addressing as the default will need to change the host and uri
27+ // see: https://github.com/awslabs/aws-sdk-kotlin/issues/220
28+ apply PutObject @httpRequestTests ([
29+ {
30+ id : " PutObjectDefaultContentType" ,
31+ documentation : " This test case validates default content-type behavior when not specified in the request" ,
32+ protocol : " aws.protocols#restXml" ,
33+ method : " PUT" ,
34+ uri : " /mybucket/mykey" ,
35+ host : " s3.us-west-2.amazonaws.com" ,
36+ body : " foobar" ,
37+ bodyMediaType : " application/octet-stream" ,
38+ headers : {
39+ "Content-Type" : " application/octet-stream"
40+ },
41+ params : {
42+ Bucket : " mybucket" ,
43+ Key : " mykey" ,
44+ Body : " foobar"
45+ }
46+ },
47+ {
48+ id : " PutOtTbjectExplicitContenype" ,
49+ documentation : " This test case validates https://github.com/awslabs/aws-sdk-kotlin/issues/193" ,
50+ protocol : " aws.protocols#restXml" ,
51+ method : " PUT" ,
52+ uri : " /mybucket/mykey" ,
53+ host : " s3.us-west-2.amazonaws.com" ,
54+ body : "{\"foo\" :\" bar\" }" ,
55+ headers : {
56+ "Content-Type" : " application/json"
57+ },
58+ params : {
59+ Bucket : " mybucket" ,
60+ Key : " mykey" ,
61+ ContentType : " application/json" ,
62+ Body : "{\"foo\" :\" bar\" }"
63+ }
64+ }
65+ ])
0 commit comments