b9dec0e3fa
Full suite command * fullsuite * fixlint
40 lines
879 B
Go
40 lines
879 B
Go
package integration_test
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"queryorchestration/internal/document"
|
|
"queryorchestration/internal/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)
|
|
}
|