From b29558c6d073091bfa30d50cac2615ff0d02ab2e Mon Sep 17 00:00:00 2001 From: Richard Gregory Date: Tue, 26 Mar 2024 13:05:32 +0100 Subject: [PATCH] Change alert manager's 'Transit' method to 'Ingress' and update manager_test --- internal/alert/manager.go | 7 +++---- internal/alert/manager_test.go | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/internal/alert/manager.go b/internal/alert/manager.go index fe0b4ee2..6c37196d 100644 --- a/internal/alert/manager.go +++ b/internal/alert/manager.go @@ -17,7 +17,7 @@ import ( // Manager ... Interface for alert manager type Manager interface { AddSession(core.UUID, *core.AlertPolicy) error - Transit() chan core.Alert + Ingress() chan core.Alert core.Subsystem } @@ -76,9 +76,8 @@ func (am *alertManager) AddSession(id core.UUID, policy *core.AlertPolicy) error return am.store.AddAlertPolicy(id, policy) } -// Transit ... Returns inter-subsystem transit channel for receiving alerts -// TODO - Rename this to ingress() -func (am *alertManager) Transit() chan core.Alert { +// Ingress ... Returns inter-subsystem transit channel for receiving alerts +func (am *alertManager) Ingress() chan core.Alert { return am.alertTransit } diff --git a/internal/alert/manager_test.go b/internal/alert/manager_test.go index 1c77c715..d4708205 100644 --- a/internal/alert/manager_test.go +++ b/internal/alert/manager_test.go @@ -53,7 +53,7 @@ func TestEventLoop(t *testing.T) { _ = am.Shutdown() }() - ingress := am.Transit() + ingress := am.Ingress() cm.SetSNSClient(sns) cm.SetSlackClients([]client.SlackClient{mocks.NewMockSlackClient(c)}, core.LOW) @@ -117,7 +117,7 @@ func TestEventLoop(t *testing.T) { _ = am.Shutdown() }() - ingress := am.Transit() + ingress := am.Ingress() cm.SetPagerDutyClients([]client.PagerDutyClient{mocks.NewMockPagerDutyClient(c)}, core.MEDIUM) cm.SetSNSClient(sns) @@ -181,7 +181,7 @@ func TestEventLoop(t *testing.T) { _ = am.Shutdown() }() - ingress := am.Transit() + ingress := am.Ingress() cm.SetSlackClients([]client.SlackClient{mocks.NewMockSlackClient(c), mocks.NewMockSlackClient(c)}, core.HIGH) cm.SetPagerDutyClients([]client.PagerDutyClient{mocks.NewMockPagerDutyClient(c), mocks.NewMockPagerDutyClient(c)}, core.HIGH)