Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
kojisaikiAtSony committed May 8, 2024
1 parent 4efb39a commit 9083ad0
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion smoke_tests/sqs_send_message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,23 @@ func Test_SendMessageV1_json_MaximumMessageSize_TooBig(t *testing.T) {
}

func Test_SendMessageV1_json_QueueNotExistant(t *testing.T) {
// TODO
server := generateServer()
defer func() {
server.Close()
utils.ResetResources()
}()

sdkConfig, _ := config.LoadDefaultConfig(context.TODO())
sdkConfig.BaseEndpoint = aws.String(server.URL)
sqsClient := sqs.NewFromConfig(sdkConfig)

// Target test: send a message to a queue that is not exist
queueUrl := "http://region.host:port/accountID/not-existant-queue"
targetMessageBody := "Test_SendMessageV1_json_no_attributes"
sendMessageOutput, err := sqsClient.SendMessage(context.TODO(), &sqs.SendMessageInput{
QueueUrl: &queueUrl,
MessageBody: &targetMessageBody,
})
assert.Contains(t, err.Error(), "400")
assert.Nil(t, sendMessageOutput)
}

0 comments on commit 9083ad0

Please sign in to comment.