package initialize_test

import (
	"testing"

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

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

		assert.NotPanics(t, func() {
			brokers := initialize.NewBrokers(initialize.BrokersDeps{
				Logger:       logger,
				TariffClient: &kgo.Client{},
			})

			assert.NotNil(t, brokers)
			assert.NotNil(t, brokers.TariffConsumer)
			assert.NotNil(t, brokers.TariffProducer)
		})
	})
}
