Files
query-orchestration/test/queryService/jobcollectorservice_test.go
T
Jay Brown 174644b63c Merged in jb/openapi (pull request #22)
add openapi infra

* add openapi infra

Includes generated stubs and all deps

* generatetolocation

* basesetupoffunctionsandclient

* round1controllertests

* passintegrationtests

* cleanupfromfullsuite

* storedjson

* fixjsonyaml

* fixtests


Approved-by: Michael McGuinness
2025-01-15 19:45:51 +00:00

36 lines
893 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 TestJobCollectorService(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.CreateJobCollectorWithResponse(ctx, queryservice.JobCollectorCreate{})
assert.Nil(t, err)
assert.NotNil(t, idRes)
id := uuid.New()
collRes, err := client.GetJobCollectorByIdWithResponse(ctx, id.String())
assert.Nil(t, err)
assert.NotNil(t, collRes)
res, err := client.UpdateJobCollectorWithResponse(ctx, id.String(), queryservice.JobCollectorUpdate{})
assert.Nil(t, err)
assert.NotNil(t, res)
}