Files
query-orchestration/test/queryService/testquery_test.go
T
Michael McGuinness 67a50bac0a Merged in bugfix/integrationstests (pull request #7)
Add get, list, create, deprecate query service integration tests

* showtestlines

* more config

* roundone

* splituptests

* splitfurther
2025-01-13 15:02:43 +00:00

40 lines
931 B
Go

package integration_test
import (
"context"
serviceinterfaces "queryorchestration/api/serviceInterfaces"
"queryorchestration/internal/test"
"testing"
"github.com/google/uuid"
"github.com/stretchr/testify/assert"
)
func TestQueryServiceTest(t *testing.T) {
ctx := context.Background()
conn, cleanup := test.CreateAPIWithDependencies(t, ctx, "queryService")
defer cleanup()
client := serviceinterfaces.NewQueryServiceClient(conn)
idRes, err := client.Create(ctx, &serviceinterfaces.QueryCreate{
Type: serviceinterfaces.QueryType_QUERY_TYPE_CONTEXT_FULL,
Config: nil,
RequiredQueries: []string{},
})
assert.Nil(t, err)
id := idRes.GetId()
assert.NotEmpty(t, id)
docId := uuid.New()
testRes, err := client.Test(ctx, &serviceinterfaces.QueryTestRequest{
QueryId: id,
DocumentId: docId.String(),
QueryVersion: int32(1),
})
assert.Nil(t, err)
assert.NotNil(t, testRes)
}