Skip to content

Commit

Permalink
refactor: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimedrolity committed Dec 7, 2022
1 parent 8ad4ba1 commit c6e66a5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions integration_tests/notifier/notifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
logging "github.com/moira-alert/moira/logging/zerolog_adapter"
"github.com/moira-alert/moira/metrics"
mock_moira_alert "github.com/moira-alert/moira/mock/moira-alert"
"github.com/moira-alert/moira/notifier"
. "github.com/moira-alert/moira/notifier"
"github.com/moira-alert/moira/notifier/events"
"github.com/moira-alert/moira/notifier/notifications"
. "github.com/smartystreets/goconvey/convey"
Expand All @@ -27,12 +27,12 @@ var senderSettings = map[string]string{
var location, _ = time.LoadLocation("UTC")
var dateTimeFormat = "15:04 02.01.2006"

var notifierConfig = notifier.Config{
var notifierConfig = Config{
SendingTimeout: time.Millisecond * 10,
ResendingTimeout: time.Hour * 24,
Location: location,
DateTimeFormat: dateTimeFormat,
ReadBatchSize: notifier.NotificationsLimitUnlimited,
ReadBatchSize: NotificationsLimitUnlimited,
}

var shutdown = make(chan struct{})
Expand Down Expand Up @@ -92,9 +92,9 @@ func TestNotifier(t *testing.T) {
err = database.PushNotificationEvent(&event, true)
So(err, ShouldBeNil)

notifier2 := notifier.NewNotifier(database, logger, notifierConfig, notifierMetrics, metricsSourceProvider, map[string]moira.ImageStore{})
notifier := NewNotifier(database, logger, notifierConfig, notifierMetrics, metricsSourceProvider, map[string]moira.ImageStore{})
sender := mock_moira_alert.NewMockSender(mockCtrl)
err = notifier2.RegisterSender(senderSettings, sender)
err = notifier.RegisterSender(senderSettings, sender)
So(err, ShouldBeNil)
sender.EXPECT().SendEvents(gomock.Any(), contact, triggerData, gomock.Any(), false).Return(nil).Do(func(arg0, arg1, arg2, arg3, arg4 interface{}) {
fmt.Print("SendEvents called. End test")
Expand All @@ -105,13 +105,13 @@ func TestNotifier(t *testing.T) {
Database: database,
Logger: logger,
Metrics: notifierMetrics,
Scheduler: notifier.NewScheduler(database, logger, notifierMetrics),
Scheduler: NewScheduler(database, logger, notifierMetrics),
}

fetchNotificationsWorker := notifications.FetchNotificationsWorker{
Database: database,
Logger: logger,
Notifier: notifier2,
Notifier: notifier,
}

fetchEventsWorker.Start()
Expand Down

0 comments on commit c6e66a5

Please sign in to comment.