package initialize_test

import (
	"testing"

	"github.com/stretchr/testify/assert"
	"go.uber.org/zap"
	"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/initialize"
	"penahub.gitlab.yandexcloud.net/pena-services/customer/internal/models"
)

func TestNewClients(t *testing.T) {
	t.Run("Клиенты должны успешно инициализироваться", func(t *testing.T) {
		logger := zap.New(zap.L().Core())

		assert.NotPanics(t, func() {
			clients := initialize.NewClients(initialize.ClientsDeps{
				Logger:                       logger,
				AuthURL:                      &models.AuthMicroserviceURL{},
				HubadminURL:                  &models.HubadminMicroserviceURL{},
				CurrencyURL:                  &models.CurrencyMicroserviceURL{},
				DiscountServiceConfiguration: &models.DiscountMicroserviceConfiguration{HostGRPC: "host"},
				PaymentServiceConfiguration:  &models.PaymentMicroserviceConfiguration{HostGRPC: "host"},
				VerificationURL:              &models.VerificationMicroserviceURL{Verification: ""},
				TemplategenURL:               &models.TemplategenMicroserviceURL{Templategen: ""},
			})

			assert.NotNil(t, clients)
			assert.NotNil(t, clients.AuthClient)
			assert.NotNil(t, clients.HubadminClient)
			assert.NotNil(t, clients.CurrencyClient)
			assert.NotNil(t, clients.DiscountClient)
			assert.NotNil(t, clients.PaymentClient)
		})
	})
}
