67a50bac0a
Add get, list, create, deprecate query service integration tests * showtestlines * more config * roundone * splituptests * splitfurther
40 lines
981 B
Go
40 lines
981 B
Go
package integration_test
|
|
|
|
import (
|
|
"context"
|
|
serviceinterfaces "queryorchestration/api/serviceInterfaces"
|
|
"queryorchestration/internal/test"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestQueryServiceList(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)
|
|
|
|
queriesRes, err := client.List(ctx, &serviceinterfaces.QueryFilter{})
|
|
assert.Nil(t, err)
|
|
assert.Len(t, queriesRes.Queries, 1)
|
|
assert.Equal(t, id, queriesRes.Queries[0].Id)
|
|
|
|
res, err := client.Update(ctx, &serviceinterfaces.QueryUpdate{
|
|
Id: id,
|
|
})
|
|
assert.Nil(t, err)
|
|
assert.NotNil(t, res)
|
|
}
|