Files
SQS-service/app/gosqs/delete_message_test.go
T
Naeel c3ba2dcae4 chore: initial import from sless/shared-sqs (v0.1.14)
- Standalone SQS-service repository
- Multi-tenant message queue service, AWS SQS compatible
- Based on GoAws, with mutable tenants, auth, WebUI, Redis persistence
- Ready for independent development and deployment
- See doc/ and README.md for architecture and usage
2026-04-10 16:47:27 +03:00

39 lines
751 B
Go

package gosqs
import (
"net/http"
"testing"
"shared-sqs/app/test"
"shared-sqs/app/fixtures"
"shared-sqs/app/models"
"github.com/stretchr/testify/assert"
)
func TestDeleteMessage(t *testing.T) {
models.CurrentEnvironment = fixtures.LOCAL_ENVIRONMENT
defer func() {
models.ResetApp()
}()
q := &models.Queue{
Name: "testing",
Messages: []models.SqsMessage{{
MessageBody: "test1",
ReceiptHandle: "123",
}},
}
models.SyncQueues.Queues["testing"] = q
_, r := test.GenerateRequestInfo("POST", "/", models.DeleteMessageRequest{
QueueUrl: "http://localhost:4100/queue/testing",
ReceiptHandle: "123",
}, true)
status, _ := DeleteMessageV1(r)
assert.Equal(t, status, http.StatusOK)
assert.Empty(t, q.Messages)
}