Files
query-orchestration/internal/serviceconfig/queue/send_test.go
T

40 lines
923 B
Go
Raw Normal View History

2025-01-10 11:12:03 +00:00
package queue_test
import (
"regexp"
2025-03-05 12:05:46 +00:00
"testing"
"queryorchestration/internal/serviceconfig"
"queryorchestration/internal/serviceconfig/objectstore"
"queryorchestration/internal/serviceconfig/queue"
"queryorchestration/internal/serviceconfig/queue/query"
"queryorchestration/internal/test"
2025-01-10 11:12:03 +00:00
2025-03-19 11:54:14 +00:00
"github.com/stretchr/testify/require"
2025-01-10 11:12:03 +00:00
)
type AWSConfig struct {
serviceconfig.BaseConfig
queue.QueueConfig
objectstore.ObjectStoreConfig
query.QueryConfig
}
2025-01-10 11:12:03 +00:00
func TestSend(t *testing.T) {
cfg := &AWSConfig{}
acfg := test.CreateAWSContainer(t, cfg)
test.SetQueueClient(t, t.Context(), cfg, acfg.ExternalEndpoint)
cfg.QueryURL = test.CreateQueue(t, cfg, test.QueryRunnerName)
params := &queue.SendParams{
QueueURL: cfg.GetQueryURL(),
Body: struct{}{},
}
2025-01-10 11:12:03 +00:00
err := cfg.SendToQueue(t.Context(), params)
2025-03-19 11:54:14 +00:00
require.NoError(t, err)
test.AssertMessageBody(t, cfg, cfg.GetQueryURL(), regexp.MustCompile("{}"))
2025-01-10 11:12:03 +00:00
}