Skip to content

Commit 5a08a3c

Browse files
updated unit tests to include notifications in common package
1 parent a3b7fba commit 5a08a3c

File tree

2 files changed

+277
-134
lines changed

2 files changed

+277
-134
lines changed

pkg/i2gw/notifications/notifications.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
)
2828

2929
func init() {
30-
NotificationAggr = NotificationAggregator{Notifications: map[string][]Notification{}}
30+
NotificationAggr = BuildNotificationAggregator()
3131
}
3232

3333
const (
@@ -55,6 +55,11 @@ var NotificationAggr NotificationAggregator
5555
// package without the common package having knowledge about which provider is making a call it
5656
type NotificationCallback func(mType MessageType, message string, CallingObjects ...client.Object)
5757

58+
// BuildNotificationAggregator returns an instance of initialized NotificationAggregator
59+
func BuildNotificationAggregator() NotificationAggregator {
60+
return NotificationAggregator{Notifications: map[string][]Notification{}}
61+
}
62+
5863
// DispatchNotification is used to send a notification to the NotificationAggregator
5964
func (na *NotificationAggregator) DispatchNotification(notification Notification, ProviderName string) {
6065
na.mutex.Lock()

0 commit comments

Comments
 (0)