From 045c3676e406dd857fe511f11b4745104b1f6f67 Mon Sep 17 00:00:00 2001 From: Jason Del Ponte Date: Sun, 25 Oct 2020 15:23:23 -0700 Subject: [PATCH] fixup s3 upload and download manager tests for EndpointResolverOptions name change --- feature/s3/manager/bucket_region_test.go | 4 ++-- feature/s3/manager/download_test.go | 4 +++- feature/s3/manager/go.mod | 6 +++--- feature/s3/manager/go.sum | 3 +++ feature/s3/manager/internal/testing/endpoints.go | 4 ++-- feature/s3/manager/upload_test.go | 3 ++- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/feature/s3/manager/bucket_region_test.go b/feature/s3/manager/bucket_region_test.go index dd56d7d1a69..c0ed0151946 100644 --- a/feature/s3/manager/bucket_region_test.go +++ b/feature/s3/manager/bucket_region_test.go @@ -67,7 +67,7 @@ func TestGetBucketRegion_Exists(t *testing.T) { server := testSetupGetBucketRegionServer(c.RespRegion, c.StatusCode, true) client := s3.New(s3.Options{ - EndpointResolver: s3testing.EndpointResolverFunc(func(region string, options s3.ResolverOptions) (aws.Endpoint, error) { + EndpointResolver: s3testing.EndpointResolverFunc(func(region string, options s3.EndpointResolverOptions) (aws.Endpoint, error) { return aws.Endpoint{ URL: server.URL, }, nil @@ -95,7 +95,7 @@ func TestGetBucketRegion_NotExists(t *testing.T) { defer server.Close() client := s3.New(s3.Options{ - EndpointResolver: s3testing.EndpointResolverFunc(func(region string, options s3.ResolverOptions) (aws.Endpoint, error) { + EndpointResolver: s3testing.EndpointResolverFunc(func(region string, options s3.EndpointResolverOptions) (aws.Endpoint, error) { return aws.Endpoint{ URL: server.URL, }, nil diff --git a/feature/s3/manager/download_test.go b/feature/s3/manager/download_test.go index 7aa2de1ce33..a0af81cf59d 100644 --- a/feature/s3/manager/download_test.go +++ b/feature/s3/manager/download_test.go @@ -464,7 +464,9 @@ func TestDownloadPartBodyRetry_FailRetry(t *testing.T) { } func TestDownloadWithContextCanceled(t *testing.T) { - d := manager.NewDownloader(s3.New(s3.Options{})) + d := manager.NewDownloader(s3.New(s3.Options{ + Region: "mock-region", + })) params := s3.GetObjectInput{ Bucket: aws.String("bucket"), diff --git a/feature/s3/manager/go.mod b/feature/s3/manager/go.mod index 2e7fa15ae1b..a63f2179f8a 100644 --- a/feature/s3/manager/go.mod +++ b/feature/s3/manager/go.mod @@ -3,10 +3,10 @@ module github.com/aws/aws-sdk-go-v2/feature/s3/manager go 1.15 require ( - github.com/aws/aws-sdk-go-v2 v0.27.0 + github.com/aws/aws-sdk-go-v2 v0.27.1-0.20201025222213-56aa7f14b50a github.com/aws/aws-sdk-go-v2/config v0.2.0 - github.com/aws/aws-sdk-go-v2/service/s3 v0.27.0 - github.com/awslabs/smithy-go v0.2.0 + github.com/aws/aws-sdk-go-v2/service/s3 v0.27.1-0.20201025222213-56aa7f14b50a + github.com/awslabs/smithy-go v0.2.1-0.20201023170655-5964f226ab39 github.com/google/go-cmp v0.4.1 ) diff --git a/feature/s3/manager/go.sum b/feature/s3/manager/go.sum index 5047ff4c35c..2a6dddbe5a6 100644 --- a/feature/s3/manager/go.sum +++ b/feature/s3/manager/go.sum @@ -3,6 +3,9 @@ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v0.0.0-20200930084 github.com/awslabs/smithy-go v0.1.0/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/awslabs/smithy-go v0.2.0 h1:lXzqqSYp5pLdLyjo4OMkyS57RrZIFPwkOayjqnBA02I= github.com/awslabs/smithy-go v0.2.0/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= +github.com/awslabs/smithy-go v0.2.1-0.20201022201941-77c3d28fb123/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= +github.com/awslabs/smithy-go v0.2.1-0.20201023170655-5964f226ab39 h1:vt3BftT5WSNBjgSNqzgz8UrH/Xc758F3oZnBVjj4rpA= +github.com/awslabs/smithy-go v0.2.1-0.20201023170655-5964f226ab39/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= diff --git a/feature/s3/manager/internal/testing/endpoints.go b/feature/s3/manager/internal/testing/endpoints.go index aa2f62ed72c..7f6edf2351d 100644 --- a/feature/s3/manager/internal/testing/endpoints.go +++ b/feature/s3/manager/internal/testing/endpoints.go @@ -6,9 +6,9 @@ import ( ) // EndpointResolverFunc is a mock s3 endpoint resolver that wraps the given function -type EndpointResolverFunc func(region string, options s3.ResolverOptions) (aws.Endpoint, error) +type EndpointResolverFunc func(region string, options s3.EndpointResolverOptions) (aws.Endpoint, error) // ResolveEndpoint returns the results from the wrapped function. -func (m EndpointResolverFunc) ResolveEndpoint(region string, options s3.ResolverOptions) (aws.Endpoint, error) { +func (m EndpointResolverFunc) ResolveEndpoint(region string, options s3.EndpointResolverOptions) (aws.Endpoint, error) { return m(region, options) } diff --git a/feature/s3/manager/upload_test.go b/feature/s3/manager/upload_test.go index 17a42c5336d..d42bfa579f3 100644 --- a/feature/s3/manager/upload_test.go +++ b/feature/s3/manager/upload_test.go @@ -741,6 +741,7 @@ func TestSSE(t *testing.T) { func TestUploadWithContextCanceled(t *testing.T) { u := manager.NewUploader(s3.New(s3.Options{ UsePathStyle: true, + Region: "mock-region", })) params := s3.PutObjectInput{ @@ -878,7 +879,7 @@ func TestUploadRetry(t *testing.T) { defer server.Close() client := s3.New(s3.Options{ - EndpointResolver: s3testing.EndpointResolverFunc(func(region string, options s3.ResolverOptions) (aws.Endpoint, error) { + EndpointResolver: s3testing.EndpointResolverFunc(func(region string, options s3.EndpointResolverOptions) (aws.Endpoint, error) { return aws.Endpoint{ URL: server.URL, }, nil