Files
query-orchestration/test/queryRunner/queryrunner_test.go
T
Michael McGuinness fa95d733ca Merged in feature/shorttestsanddirtidy (pull request #26)
Add short tests and Tidy internal directories

* complete the tasks
2025-01-17 12:00:32 +00:00

40 lines
892 B
Go

package integration_test
import (
"context"
"encoding/json"
"queryorchestration/internal/query/document"
"queryorchestration/internal/server/queue"
"queryorchestration/internal/test"
"testing"
"github.com/aws/aws-sdk-go-v2/service/sqs/types"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
)
func TestQueryRunner(t *testing.T) {
ctx := context.Background()
qCfg, cleanup := test.CreateQueueWithDependencies(t, ctx, "queryRunner")
defer cleanup()
document := document.Document{
ID: uuid.New(),
JobID: uuid.New(),
Name: "documentname",
CleanVersion: int32(1),
TextVersion: int32(1),
}
docJson, err := json.Marshal(document)
assert.Nil(t, err)
cfg := &queue.Config{
URL: qCfg.URL,
Client: qCfg.Client,
}
err = queue.Send(ctx, cfg, string(docJson), map[string]types.MessageAttributeValue{})
assert.Nil(t, err)
}