Merged in feature/standardisefilepath (pull request #111)

Feature/standardisefilepath

* baseprocessing

* generalstructure
This commit is contained in:
Michael McGuinness
2025-04-03 12:13:16 +00:00
parent 81e7223560
commit 1d49313a9f
17 changed files with 466 additions and 253 deletions
+8 -3
View File
@@ -10,6 +10,7 @@ import (
"queryorchestration/internal/document"
documentinit "queryorchestration/internal/document/init"
"queryorchestration/internal/server/runner"
"queryorchestration/internal/serviceconfig/objectstore"
"queryorchestration/internal/serviceconfig/queue/documentsync"
queuemock "queryorchestration/mocks/queue"
@@ -47,7 +48,11 @@ func TestDocInitRunner(t *testing.T) {
t.Run("valid", func(t *testing.T) {
clientId := "clientid"
bucketName := "bucketName"
location := fmt.Sprintf("%s/import/aaa", clientId)
location := objectstore.BucketKey{
Location: objectstore.Import,
ClientID: clientId,
Filename: "aaa",
}
docinfo := document.DocumentSummary{
ID: uuid.New(),
ClientID: "hello",
@@ -55,7 +60,7 @@ func TestDocInitRunner(t *testing.T) {
}
doc := docinitrunner.Body{
Bucket: bucketName,
Key: location,
Key: location.String(),
Hash: docinfo.Hash,
ClientID: clientId,
}
@@ -69,7 +74,7 @@ func TestDocInitRunner(t *testing.T) {
pgxmock.NewRows([]string{"id"}).
AddRow(docinfo.ID),
)
pool.ExpectExec("name: AddDocumentEntry :exec").WithArgs(docinfo.ID, bucketName, location).
pool.ExpectExec("name: AddDocumentEntry :exec").WithArgs(docinfo.ID, bucketName, location.String()).
WillReturnResult(pgxmock.NewResult("", 1))
pool.ExpectCommit()
pool.ExpectQuery("name: GetDocumentSummary :one").WithArgs(docinfo.ID).