Files
query-orchestration/internal/query/sync/service_test.go
T

30 lines
704 B
Go
Raw Normal View History

package querysync_test
import (
"queryorchestration/internal/database/repository"
querysync "queryorchestration/internal/query/sync"
"queryorchestration/internal/serviceconfig"
"queryorchestration/internal/serviceconfig/queue/query"
"testing"
"github.com/pashagolub/pgxmock/v3"
"github.com/stretchr/testify/assert"
)
type QuerySyncConfig struct {
serviceconfig.BaseConfig
query.QueryConfig
}
func TestService(t *testing.T) {
pool, err := pgxmock.NewPool()
if err != nil {
t.Fatalf("failed to open pgxmock database: %v", err)
}
cfg := &QuerySyncConfig{}
cfg.DBPool = pool
cfg.DBQueries = repository.New(pool)
svc := querysync.New(cfg, &querysync.Services{})
assert.NotNil(t, svc)
}