Merged in feature/shorttestsanddirtidy (pull request #26)
Add short tests and Tidy internal directories * complete the tasks
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package queue_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"queryorchestration/internal/server/queue"
|
||||
"queryorchestration/internal/test"
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/service/sqs/types"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestDelete(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping long test in short mode")
|
||||
}
|
||||
ctx := context.Background()
|
||||
queueConfig, cleanup := test.CreateQueue(t, ctx, &test.CreateQueueConfig{})
|
||||
defer cleanup()
|
||||
|
||||
cfg := &queue.Config{
|
||||
URL: queueConfig.URL,
|
||||
Client: queueConfig.Client,
|
||||
}
|
||||
|
||||
err := queue.Send(ctx, cfg, "{}", map[string]types.MessageAttributeValue{})
|
||||
assert.Nil(t, err)
|
||||
|
||||
message := test.AssertMessageWait(t, ctx, cfg, []string{})
|
||||
|
||||
err = queue.Delete(ctx, cfg, &message)
|
||||
assert.Nil(t, err)
|
||||
}
|
||||
Reference in New Issue
Block a user