Files
query-orchestration/api/queryAPI/testutils_test.go
T
Jay Brown 2eff52877b Merged in feature/download-pdf (pull request #216)
retrieve document by id and tests

* working

* missing files
2026-03-17 17:06:57 +00:00

76 lines
2.4 KiB
Go

package queryapi_test
import (
queryapi "queryorchestration/api/queryAPI"
"queryorchestration/internal/backgroundtask"
"queryorchestration/internal/client"
clientupdate "queryorchestration/internal/client/update"
"queryorchestration/internal/collector"
collectorset "queryorchestration/internal/collector/set"
"queryorchestration/internal/document"
documentbatch "queryorchestration/internal/document/batch"
documentdownload "queryorchestration/internal/document/download"
documentupload "queryorchestration/internal/document/upload"
"queryorchestration/internal/eula"
"queryorchestration/internal/export"
"queryorchestration/internal/fieldextraction"
"queryorchestration/internal/folder"
"queryorchestration/internal/label"
"queryorchestration/internal/server/api"
"queryorchestration/internal/serviceconfig/queue/clientsync"
"queryorchestration/internal/uisettings"
)
// ControllerConfig provides test configuration for API controllers.
// Note: Query-related configurations have been removed. See remove_query_plan.md.
type ControllerConfig struct {
api.BaseConfig
clientsync.ClientSyncConfig
BackgroundRunner *backgroundtask.Runner
}
// GetBackgroundRunner returns the background runner for batch processing.
func (c *ControllerConfig) GetBackgroundRunner() *backgroundtask.Runner {
return c.BackgroundRunner
}
// createControllerServices creates a Services struct for testing.
// Note: Query-related services have been removed. See remove_query_plan.md.
func createControllerServices(cfg *ControllerConfig) *queryapi.Services {
exp := export.New()
col := collector.New(cfg)
colupdate := collectorset.New(cfg, &collectorset.Services{
Collector: col,
})
cli := client.New(cfg)
cliUpdate := clientupdate.New(cfg, &clientupdate.Services{
Client: cli,
})
doc := document.New(cfg)
docup := documentupload.New(cfg)
docdownload := documentdownload.New(cfg)
docbatch := documentbatch.New(cfg)
fieldext := fieldextraction.New(cfg)
fld := folder.New(cfg)
lbl := label.New(cfg)
eul := eula.New(cfg)
uiSvc := uisettings.New(cfg)
return &queryapi.Services{
Export: exp,
Collector: col,
CollectorSet: colupdate,
Client: cli,
ClientUpdate: cliUpdate,
Document: doc,
DocumentUpload: docup,
DocumentDownload: docdownload,
DocumentBatch: docbatch,
UISettings: uiSvc,
FieldExtraction: fieldext,
Folder: fld,
Label: lbl,
Eula: eul,
}
}