shared-sqs: Этап 1 — клон GoAWS, удаление SNS, go build OK

This commit is contained in:
Naeel
2026-04-09 12:25:02 +03:00
parent d1d1bffd7c
commit f4352a17b1
58 changed files with 9688 additions and 0 deletions
@@ -0,0 +1,38 @@
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)
}