diff --git a/aws/sqs/sqs.go b/aws/sqs/sqs.go index 58c7a4b..9b36026 100644 --- a/aws/sqs/sqs.go +++ b/aws/sqs/sqs.go @@ -92,6 +92,11 @@ func (s *SQS) Ready() bool { return s.client != nil } +// Client returns the underlying SQS client. +func (s *SQS) Client() *sqs.Client { + return s.client +} + // Receive receives a raw message or error from the queue. // After a successful receive the message will be in flight // until it is either deleted or the visibility timeout expires diff --git a/aws/sqs/sqs_integration_test.go b/aws/sqs/sqs_integration_test.go index 0f26841..9f2a0f7 100644 --- a/aws/sqs/sqs_integration_test.go +++ b/aws/sqs/sqs_integration_test.go @@ -206,6 +206,24 @@ func TestCheckQueue(t *testing.T) { } +func TestSQSClient(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 TestSQSNewAndReady(t *testing.T) { // ARRANGE setup()