Merged in bugfix/integrationstests (pull request #7)

Add get, list, create, deprecate query service integration tests

* showtestlines

* more config

* roundone

* splituptests

* splitfurther
This commit is contained in:
Michael McGuinness
2025-01-13 15:02:43 +00:00
parent 6b733f8c24
commit 67a50bac0a
10 changed files with 241 additions and 50 deletions
+39
View File
@@ -0,0 +1,39 @@
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)
}