2023-05-16 01:12:07 +00:00
|
|
|
package initialize_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
2023-05-19 04:50:40 +00:00
|
|
|
"go.uber.org/zap"
|
2023-05-16 04:01:55 +00:00
|
|
|
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/initialize"
|
2023-05-19 04:50:40 +00:00
|
|
|
"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
|
2023-05-16 01:12:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestNewClients(t *testing.T) {
|
|
|
|
t.Run("Клиенты должны успешно инициализироваться", func(t *testing.T) {
|
2023-05-19 04:50:40 +00:00
|
|
|
logger := zap.New(zap.L().Core())
|
|
|
|
|
2023-05-16 01:12:07 +00:00
|
|
|
assert.NotPanics(t, func() {
|
2023-05-19 04:50:40 +00:00
|
|
|
clients := initialize.NewClients(&initialize.ClientsDeps{
|
2023-05-23 15:42:22 +00:00
|
|
|
Logger: logger,
|
|
|
|
AuthURL: &models.AuthMicroserviceURL{},
|
|
|
|
HubadminURL: &models.HubadminMicroserviceURL{},
|
2023-05-19 04:50:40 +00:00
|
|
|
})
|
2023-05-16 01:12:07 +00:00
|
|
|
|
|
|
|
assert.NotNil(t, clients)
|
|
|
|
assert.NotNil(t, clients.AuthClient)
|
2023-05-19 09:08:15 +00:00
|
|
|
assert.NotNil(t, clients.HubadminClient)
|
2023-05-16 01:12:07 +00:00
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|