Merged in feature/standardisefilepath (pull request #111)
Feature/standardisefilepath * baseprocessing * generalstructure
This commit is contained in:
@@ -2,13 +2,14 @@ package storeeventrunner
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"queryorchestration/internal/database/repository"
|
||||
"queryorchestration/internal/document"
|
||||
documentstore "queryorchestration/internal/document/store"
|
||||
"queryorchestration/internal/server/runner"
|
||||
"queryorchestration/internal/serviceconfig/objectstore"
|
||||
"queryorchestration/internal/serviceconfig/queue/documentinit"
|
||||
"queryorchestration/internal/serviceconfig/queue/documenttextprocess"
|
||||
queuemock "queryorchestration/mocks/queue"
|
||||
@@ -50,7 +51,12 @@ func TestDocInitRunner(t *testing.T) {
|
||||
t.Run("valid", func(t *testing.T) {
|
||||
clientId := "hi"
|
||||
bucketName := "bucketName"
|
||||
location := fmt.Sprintf("%s/import/aaa", clientId)
|
||||
location := objectstore.BucketKey{
|
||||
Location: objectstore.Import,
|
||||
ClientID: clientId,
|
||||
Filename: "aaa",
|
||||
CreatedAt: time.Now().UTC(),
|
||||
}
|
||||
docinfo := document.DocumentSummary{
|
||||
ID: uuid.New(),
|
||||
ClientID: clientId,
|
||||
@@ -65,7 +71,7 @@ func TestDocInitRunner(t *testing.T) {
|
||||
Name: bucketName,
|
||||
},
|
||||
Object: S3Object{
|
||||
Key: location,
|
||||
Key: location.String(),
|
||||
ETag: docinfo.Hash,
|
||||
},
|
||||
},
|
||||
@@ -82,7 +88,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).
|
||||
|
||||
Reference in New Issue
Block a user