Merged in feature/richname (pull request #112)
Standardised rich name for Files * tests
This commit is contained in:
@@ -29,10 +29,9 @@ func New(validator *validator.Validate, svc *Services) Runner {
|
||||
}
|
||||
|
||||
type Body struct {
|
||||
Bucket string `json:"bucket" validate:"required"`
|
||||
Key string `json:"key" validate:"required"`
|
||||
Hash string `json:"hash" validate:"required"`
|
||||
ClientID string `json:"clientId" validate:"required"`
|
||||
Bucket string `json:"bucket" validate:"required"`
|
||||
Key string `json:"key" validate:"required"`
|
||||
Hash string `json:"hash" validate:"required"`
|
||||
}
|
||||
|
||||
func (s Runner) Process(ctx context.Context, body Body) bool {
|
||||
@@ -43,10 +42,9 @@ func (s Runner) Process(ctx context.Context, body Body) bool {
|
||||
}
|
||||
|
||||
err = s.svc.Text.Process(ctx, &documenttext.ProcessParams{
|
||||
Bucket: body.Bucket,
|
||||
Key: key,
|
||||
Hash: body.Hash,
|
||||
ClientID: body.ClientID,
|
||||
Bucket: body.Bucket,
|
||||
Key: key,
|
||||
Hash: body.Hash,
|
||||
})
|
||||
if err != nil {
|
||||
slog.Error("unable to process", "bucket", body.Bucket, "key", body.Key, "hash", body.Hash, "error", err)
|
||||
|
||||
@@ -72,14 +72,13 @@ func TestDocTextProcessRunner(t *testing.T) {
|
||||
key := objectstore.BucketKey{
|
||||
ClientID: docinfo.ClientID,
|
||||
Location: objectstore.TextTextract,
|
||||
Filename: triggerId.String(),
|
||||
EntityID: triggerId,
|
||||
CreatedAt: time.Now().UTC(),
|
||||
}
|
||||
doc := Body{
|
||||
Bucket: bucketName,
|
||||
Key: key.String(),
|
||||
Hash: docinfo.Hash,
|
||||
ClientID: docinfo.ClientID,
|
||||
Bucket: bucketName,
|
||||
Key: key.String(),
|
||||
Hash: docinfo.Hash,
|
||||
}
|
||||
|
||||
pool.ExpectQuery("name: GetDocumentTextTrigger :one").WithArgs(triggerId).WillReturnRows(
|
||||
@@ -139,14 +138,13 @@ func TestDocTextProcessRunner(t *testing.T) {
|
||||
key := objectstore.BucketKey{
|
||||
ClientID: docinfo.ClientID,
|
||||
Location: objectstore.TextTextract,
|
||||
Filename: triggerId.String(),
|
||||
EntityID: triggerId,
|
||||
CreatedAt: time.Now().UTC(),
|
||||
}
|
||||
doc := Body{
|
||||
Bucket: bucketName,
|
||||
Key: key.String(),
|
||||
Hash: docinfo.Hash,
|
||||
ClientID: docinfo.ClientID,
|
||||
Bucket: bucketName,
|
||||
Key: key.String(),
|
||||
Hash: docinfo.Hash,
|
||||
}
|
||||
|
||||
pool.ExpectQuery("name: GetDocumentTextTrigger :one").WithArgs(triggerId).
|
||||
|
||||
Reference in New Issue
Block a user