Skip to content

Commit

Permalink
example/service/s3/mockPaginator: Update example to not use internal …
Browse files Browse the repository at this point in the history
…pkg (#278)

Updates the SDK's S3 Mock Paginator example to not use internal SDK packages and instead use the SDK's provided defaults package for default configuration.

Fix #116
  • Loading branch information
jasdel authored Mar 18, 2019
1 parent 381987c commit 63e81a5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions example/service/s3/mockPaginator/mockPaginator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awstesting/unit"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
"github.com/aws/aws-sdk-go-v2/service/s3"
)

Expand All @@ -20,11 +20,7 @@ func (c *mockS3Client) ListObjectsRequest(input *s3.ListObjectsInput) s3.ListObj
req := c.S3.ListObjectsRequest(input)
req.Copy = func(v *s3.ListObjectsInput) s3.ListObjectsRequest {
r := c.S3.ListObjectsRequest(v)
r.Handlers.Send.Clear()
r.Handlers.Unmarshal.Clear()
r.Handlers.UnmarshalMeta.Clear()
r.Handlers.UnmarshalError.Clear()
r.Handlers.ValidateResponse.Clear()
r.Handlers.Clear()
r.Handlers.Send.PushBack(func(r *aws.Request) {
object := c.objects[c.index]
r.Data = &object
Expand Down Expand Up @@ -76,7 +72,7 @@ func TestListObjectsPagination(t *testing.T) {
},
}

svc.S3 = s3.New(unit.Config())
svc.S3 = s3.New(defaults.Config())
svc.objects = objects

keys := getKeys(svc, "foo")
Expand Down

0 comments on commit 63e81a5

Please sign in to comment.