Merged in feature/collectorset (pull request #96)

Set Collector

* set
This commit is contained in:
Michael McGuinness
2025-03-10 13:00:57 +00:00
parent 62886dbba8
commit ed8cfbbee4
35 changed files with 430 additions and 783 deletions
+2 -2
View File
@@ -174,8 +174,8 @@ func TestProcess(t *testing.T) {
RequiredQueries: &[]types.UUID{contextQueryRes.JSON201.Id},
})
assert.NoError(t, err)
newActiveVersion := int32(2)
_, err = qService.UpdateCollectorByClientIdWithResponse(ctx, clientRes.JSON201.Id, queryservice.CollectorUpdate{
newActiveVersion := int32(1)
_, err = qService.SetCollectorByClientIdWithResponse(ctx, clientRes.JSON201.Id, queryservice.CollectorSet{
ActiveVersion: &newActiveVersion,
Fields: &[]queryservice.CollectorField{
{
+6 -6
View File
@@ -80,20 +80,20 @@ func TestCollectorService(t *testing.T) {
collRes, err := client.GetCollectorByClientIdWithResponse(ctx, id)
assert.NoError(t, err)
assert.Equal(t, id, collRes.JSON200.ClientId)
assert.Equal(t, int32(1), collRes.JSON200.ActiveVersion)
assert.Equal(t, int32(1), collRes.JSON200.LatestVersion)
assert.Equal(t, int32(0), collRes.JSON200.ActiveVersion)
assert.Equal(t, int32(0), collRes.JSON200.LatestVersion)
assert.Equal(t, int32(0), collRes.JSON200.MinimumCleanerVersion)
assert.Equal(t, int32(0), collRes.JSON200.MinimumTextVersion)
assert.Len(t, collRes.JSON200.Fields, 0)
av := int32(2)
av := int32(1)
fields := []queryservice.CollectorField{
{
Name: "json",
QueryId: jsonRes.JSON201.Id,
},
}
uRes, err := client.UpdateCollectorByClientIdWithResponse(ctx, id, queryservice.CollectorUpdate{
uRes, err := client.SetCollectorByClientIdWithResponse(ctx, id, queryservice.CollectorSet{
ActiveVersion: &av,
Fields: &fields,
})
@@ -106,8 +106,8 @@ func TestCollectorService(t *testing.T) {
collRes, err = client.GetCollectorByClientIdWithResponse(ctx, id)
assert.NoError(t, err)
assert.Equal(t, id, collRes.JSON200.ClientId)
assert.Equal(t, int32(2), collRes.JSON200.ActiveVersion)
assert.Equal(t, int32(2), collRes.JSON200.LatestVersion)
assert.Equal(t, int32(1), collRes.JSON200.ActiveVersion)
assert.Equal(t, int32(1), collRes.JSON200.LatestVersion)
assert.Equal(t, int32(0), collRes.JSON200.MinimumCleanerVersion)
assert.Equal(t, int32(0), collRes.JSON200.MinimumTextVersion)
assert.Len(t, collRes.JSON200.Fields, 1)