Merged in feature/movefromtrigger (pull request #164)
Single Text Queue * notrigger
This commit is contained in:
@@ -33,7 +33,7 @@ func (s *Service) Clean(ctx context.Context, documentId uuid.UUID) error {
|
||||
|
||||
func (s *Service) informClean(ctx context.Context, documentId uuid.UUID) error {
|
||||
err := s.cfg.SendToQueue(ctx, &queue.SendParams{
|
||||
QueueURL: s.cfg.GetDocumentTextTriggerURL(),
|
||||
QueueURL: s.cfg.GetDocumentTextURL(),
|
||||
Body: doctextrunner.Body{
|
||||
DocumentID: documentId,
|
||||
},
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"queryorchestration/internal/serviceconfig"
|
||||
"queryorchestration/internal/serviceconfig/aws"
|
||||
"queryorchestration/internal/serviceconfig/objectstore"
|
||||
"queryorchestration/internal/serviceconfig/queue/documenttexttrigger"
|
||||
"queryorchestration/internal/serviceconfig/queue/documenttext"
|
||||
objectstoremock "queryorchestration/mocks/objectstore"
|
||||
queuemock "queryorchestration/mocks/queue"
|
||||
|
||||
@@ -27,7 +27,7 @@ import (
|
||||
type DocCleanConfig struct {
|
||||
aws.AWSConfig
|
||||
serviceconfig.BaseConfig
|
||||
documenttexttrigger.DocTextTriggerConfig
|
||||
documenttext.DocTextConfig
|
||||
objectstore.ObjectStoreConfig
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ func TestCreate(t *testing.T) {
|
||||
|
||||
cfg := &DocCleanConfig{}
|
||||
cfg.QueueClient = mockSQS
|
||||
cfg.DocumentTextTriggerURL = "/i/am/here"
|
||||
cfg.DocumentTextURL = "/i/am/here"
|
||||
cfg.DBPool = pool
|
||||
cfg.DBQueries = repository.New(pool)
|
||||
mockS3 := objectstoremock.NewMockS3Client(t)
|
||||
@@ -102,7 +102,7 @@ func TestCreate(t *testing.T) {
|
||||
SendMessage(
|
||||
mock.Anything,
|
||||
mock.MatchedBy(func(in *sqs.SendMessageInput) bool {
|
||||
return *in.QueueUrl == cfg.DocumentTextTriggerURL && *in.MessageBody == fmt.Sprintf("{\"id\":\"%s\"}", doc.ID)
|
||||
return *in.QueueUrl == cfg.DocumentTextURL && *in.MessageBody == fmt.Sprintf("{\"id\":\"%s\"}", doc.ID)
|
||||
}),
|
||||
mock.Anything,
|
||||
).
|
||||
@@ -143,7 +143,7 @@ func TestInformClean(t *testing.T) {
|
||||
|
||||
cfg := &DocCleanConfig{}
|
||||
cfg.QueueClient = mockSQS
|
||||
cfg.DocumentTextTriggerURL = "/i/am/here"
|
||||
cfg.DocumentTextURL = "/i/am/here"
|
||||
svc := Service{
|
||||
cfg: cfg,
|
||||
}
|
||||
@@ -153,7 +153,7 @@ func TestInformClean(t *testing.T) {
|
||||
SendMessage(
|
||||
mock.Anything,
|
||||
mock.MatchedBy(func(in *sqs.SendMessageInput) bool {
|
||||
return *in.QueueUrl == cfg.DocumentTextTriggerURL && *in.MessageBody == fmt.Sprintf("{\"id\":\"%s\"}", id)
|
||||
return *in.QueueUrl == cfg.DocumentTextURL && *in.MessageBody == fmt.Sprintf("{\"id\":\"%s\"}", id)
|
||||
}),
|
||||
mock.Anything,
|
||||
).
|
||||
|
||||
@@ -3,12 +3,12 @@ package documentclean
|
||||
import (
|
||||
"queryorchestration/internal/serviceconfig"
|
||||
"queryorchestration/internal/serviceconfig/objectstore"
|
||||
"queryorchestration/internal/serviceconfig/queue/documenttexttrigger"
|
||||
"queryorchestration/internal/serviceconfig/queue/documenttext"
|
||||
)
|
||||
|
||||
type ConfigProvider interface {
|
||||
serviceconfig.ConfigProvider
|
||||
documenttexttrigger.ConfigProvider
|
||||
documenttext.ConfigProvider
|
||||
objectstore.ConfigProvider
|
||||
}
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@ import (
|
||||
documentclean "queryorchestration/internal/document/clean"
|
||||
"queryorchestration/internal/serviceconfig"
|
||||
"queryorchestration/internal/serviceconfig/objectstore"
|
||||
"queryorchestration/internal/serviceconfig/queue/documenttexttrigger"
|
||||
"queryorchestration/internal/serviceconfig/queue/documenttext"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
type DocCleanConfig struct {
|
||||
serviceconfig.BaseConfig
|
||||
documenttexttrigger.DocTextTriggerConfig
|
||||
documenttext.DocTextConfig
|
||||
objectstore.ConfigProvider
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user