Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions aws/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ func (s *S3) Ready() bool {
return s.client != nil
}

// Client returns the underlying S3 client.
func (s *S3) Client() *s3.Client {
return s.client
}

// Get gets the object referred to by key and version from bucket and writes it into b.
// Version can be empty.
func (s *S3) Get(bucket, key, version string, b *bytes.Buffer) error {
Expand Down
18 changes: 18 additions & 0 deletions aws/s3/s3_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,24 @@ func TestCreateS3ClientWithOptions(t *testing.T) {
assert.Nil(t, err)
}

func TestS3Client(t *testing.T) {
// ARRANGE
setup()
defer teardown()

client, err := New()
ready := client.Ready()

require.Nil(t, err)
require.True(t, ready)

// ACTION
underlyingClient := client.Client()

// ASSERT
assert.NotNil(t, underlyingClient)
}

func TestS3Get(t *testing.T) {
// ARRANGE
setup()
Expand Down
5 changes: 5 additions & 0 deletions aws/sns/sns.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ func (s *SNS) Ready() bool {
return s.client != nil
}

// Client returns the underlying SNS client.
func (s *SNS) Client() *sns.Client {
return s.client
}

// Publish publishes message to topicArn.
func (s *SNS) Publish(topicArn string, message []byte) error {
input := sns.PublishInput{
Expand Down
18 changes: 18 additions & 0 deletions aws/sns/sns_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,24 @@ func TestSNSNewWithRetries(t *testing.T) {
assert.NotNil(t, err)
}

func TestSNSClient(t *testing.T) {
// ARRANGE
setup(false, false)
defer teardown("", "")

client, err := New()
ready := client.Ready()

require.Nil(t, err)
require.True(t, ready)

// ACTION
underlyingClient := client.Client()

// ASSERT
assert.NotNil(t, underlyingClient)
}

func TestSNSPublish(t *testing.T) {
// ARRANGE
queueArn, topicArn := setup(true, true)
Expand Down
Loading