2025-03-10 13:00:57 +00:00
|
|
|
package collectorset_test
|
2025-02-12 19:00:25 +00:00
|
|
|
|
|
|
|
|
import (
|
2025-03-05 12:05:46 +00:00
|
|
|
"testing"
|
|
|
|
|
|
2025-03-10 13:00:57 +00:00
|
|
|
collectorset "queryorchestration/internal/collector/set"
|
2025-02-12 19:00:25 +00:00
|
|
|
"queryorchestration/internal/database/repository"
|
|
|
|
|
|
|
|
|
|
"github.com/pashagolub/pgxmock/v3"
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2025-03-04 15:51:03 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
2025-02-12 19:00:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestService(t *testing.T) {
|
|
|
|
|
pool, err := pgxmock.NewPool()
|
2025-03-04 15:51:03 +00:00
|
|
|
require.NoError(t, err)
|
2025-03-10 13:00:57 +00:00
|
|
|
cfg := &CollectorSetConfig{}
|
2025-02-12 19:00:25 +00:00
|
|
|
cfg.DBPool = pool
|
|
|
|
|
cfg.DBQueries = repository.New(pool)
|
|
|
|
|
|
2025-03-10 13:00:57 +00:00
|
|
|
svc := collectorset.New(cfg, &collectorset.Services{})
|
2025-02-12 19:00:25 +00:00
|
|
|
assert.NotNil(t, svc)
|
|
|
|
|
}
|