Merged in feature/jobsync (pull request #63)
Document Sync and Job Sync * docsyncfunc * startedQueryWork * morefixes * jobsyncsvcstart * save * jobsynctext * save * save * docsync * shorttest * jobsync * jobsyncupdateoncollectorupdate * passlivetest * collectortest * lint
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package documentsync
|
||||
|
||||
type DocSyncConfig struct {
|
||||
DocumentSyncURL string `env:"DOCUMENT_SYNC_URL,required,notEmpty"`
|
||||
}
|
||||
|
||||
func (c *DocSyncConfig) GetDocumentSyncURL() string {
|
||||
return c.DocumentSyncURL
|
||||
}
|
||||
|
||||
type ConfigProvider interface {
|
||||
GetDocumentSyncURL() string
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package documentsync_test
|
||||
|
||||
import (
|
||||
"queryorchestration/internal/serviceconfig/queue/documentsync"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestGetDocumentSyncURL(t *testing.T) {
|
||||
cfg := documentsync.DocSyncConfig{}
|
||||
|
||||
name := cfg.GetDocumentSyncURL()
|
||||
assert.Equal(t, "", name)
|
||||
|
||||
cfg.DocumentSyncURL = "name"
|
||||
name = cfg.GetDocumentSyncURL()
|
||||
assert.Equal(t, "name", name)
|
||||
assert.Equal(t, cfg.DocumentSyncURL, name)
|
||||
}
|
||||
Reference in New Issue
Block a user