Files
query-orchestration/test/queryRunner/queryrunner_test.go
T
Michael McGuinness b16ff55afa Merged in feature/document (pull request #36)
Document CRUD

* doccreate

* dochashlocandget

* depsandtodo
2025-01-24 16:12:25 +00:00

39 lines
876 B
Go

package integration_test
import (
"context"
"encoding/json"
documentsync "queryorchestration/internal/document/sync"
"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 := documentsync.Document{
ID: uuid.New(),
JobID: uuid.New(),
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)
}