Merged in feature/movefromtrigger (pull request #164)
Single Text Queue * notrigger
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package documenttext
|
||||
|
||||
const EnvName = "DOCUMENT_TEXT_URL"
|
||||
|
||||
type DocTextConfig struct {
|
||||
DocumentTextURL string `env:"DOCUMENT_TEXT_URL,required,notEmpty"`
|
||||
}
|
||||
|
||||
func (c *DocTextConfig) GetDocumentTextURL() string {
|
||||
return c.DocumentTextURL
|
||||
}
|
||||
|
||||
type ConfigProvider interface {
|
||||
GetDocumentTextURL() string
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package documenttext_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"queryorchestration/internal/serviceconfig/queue/documenttext"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestGetDocumentTextURL(t *testing.T) {
|
||||
cfg := documenttext.DocTextConfig{}
|
||||
|
||||
name := cfg.GetDocumentTextURL()
|
||||
assert.Equal(t, "", name)
|
||||
|
||||
cfg.DocumentTextURL = "name"
|
||||
name = cfg.GetDocumentTextURL()
|
||||
assert.Equal(t, "name", name)
|
||||
assert.Equal(t, cfg.DocumentTextURL, name)
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package documenttexttrigger
|
||||
|
||||
const EnvName = "DOCUMENT_TEXT_TRIGGER_URL"
|
||||
|
||||
type DocTextTriggerConfig struct {
|
||||
DocumentTextTriggerURL string `env:"DOCUMENT_TEXT_TRIGGER_URL,required,notEmpty"`
|
||||
}
|
||||
|
||||
func (c *DocTextTriggerConfig) GetDocumentTextTriggerURL() string {
|
||||
return c.DocumentTextTriggerURL
|
||||
}
|
||||
|
||||
type ConfigProvider interface {
|
||||
GetDocumentTextTriggerURL() string
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package documenttexttrigger_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"queryorchestration/internal/serviceconfig/queue/documenttexttrigger"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestGetDocumentTextURL(t *testing.T) {
|
||||
cfg := documenttexttrigger.DocTextTriggerConfig{}
|
||||
|
||||
name := cfg.GetDocumentTextTriggerURL()
|
||||
assert.Equal(t, "", name)
|
||||
|
||||
cfg.DocumentTextTriggerURL = "name"
|
||||
name = cfg.GetDocumentTextTriggerURL()
|
||||
assert.Equal(t, "name", name)
|
||||
assert.Equal(t, cfg.DocumentTextTriggerURL, name)
|
||||
}
|
||||
Reference in New Issue
Block a user