0ac5ff9e15
Test Query * depstextandclean * startedcleaningresult * resulttidyup * roundone * cleaning * unsyncedquery * startedtestsandsimplification * api * querytests * resultprocessortests * unittests * cleanup
40 lines
943 B
Go
40 lines
943 B
Go
package integration_test
|
|
|
|
import (
|
|
"context"
|
|
"queryorchestration/internal/test"
|
|
queryservice "queryorchestration/pkg/queryService"
|
|
"testing"
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestQueryServiceTest(t *testing.T) {
|
|
ctx := context.Background()
|
|
|
|
address, cleanup := test.CreateAPIWithDependencies(t, ctx, "queryService")
|
|
defer cleanup()
|
|
|
|
client, err := queryservice.NewClientWithResponses(address)
|
|
assert.Nil(t, err)
|
|
|
|
idRes, err := client.CreateQueryWithResponse(ctx, queryservice.QueryCreate{
|
|
Type: queryservice.CONTEXTFULL,
|
|
})
|
|
assert.Nil(t, err)
|
|
id := idRes.JSON201.Id
|
|
assert.NotEmpty(t, id)
|
|
|
|
docId := uuid.New()
|
|
|
|
testRes, err := client.TestQueryWithResponse(ctx, id, queryservice.QueryTestRequest{
|
|
DocumentId: docId,
|
|
QueryVersion: int32(1),
|
|
})
|
|
assert.Nil(t, err)
|
|
assert.NotNil(t, testRes)
|
|
// assert.NotNil(t, testRes.JSON200)
|
|
// assert.Equal(t, "hey", testRes.JSON200.Value)
|
|
}
|