2025-01-21 18:24:14 +00:00
|
|
|
package client_test
|
|
|
|
|
|
|
|
|
|
import (
|
2025-03-05 12:05:46 +00:00
|
|
|
"testing"
|
|
|
|
|
|
2025-01-21 18:24:14 +00:00
|
|
|
"queryorchestration/internal/client"
|
|
|
|
|
"queryorchestration/internal/database/repository"
|
2025-01-31 13:43:55 +00:00
|
|
|
"queryorchestration/internal/serviceconfig"
|
2025-01-21 18:24:14 +00:00
|
|
|
|
|
|
|
|
"github.com/pashagolub/pgxmock/v3"
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2025-03-04 15:51:03 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
2025-01-21 18:24:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestService(t *testing.T) {
|
|
|
|
|
pool, err := pgxmock.NewPool()
|
2025-03-04 15:51:03 +00:00
|
|
|
require.NoError(t, err)
|
2025-01-31 13:43:55 +00:00
|
|
|
cfg := &serviceconfig.BaseConfig{}
|
|
|
|
|
cfg.DBPool = pool
|
|
|
|
|
cfg.DBQueries = repository.New(pool)
|
2025-01-21 18:24:14 +00:00
|
|
|
|
2025-03-10 13:00:57 +00:00
|
|
|
svc := client.New(cfg)
|
2025-01-21 18:24:14 +00:00
|
|
|
assert.NotNil(t, svc)
|
|
|
|
|
}
|