Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Add test for NewNotificationsPublisher and NewNotificationsProcessor …
Browse files Browse the repository at this point in the history
…in factory_test.go

Signed-off-by: Future Outlier <[email protected]>
  • Loading branch information
Future Outlier committed Aug 1, 2023
1 parent be74e6e commit 45b050e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/async/notifications/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@ package notifications
import (
"testing"

"github.com/flyteorg/flyteadmin/pkg/async/notifications/implementations"
runtimeInterfaces "github.com/flyteorg/flyteadmin/pkg/runtime/interfaces"
"github.com/flyteorg/flytestdlib/promutils"
"github.com/stretchr/testify/assert"
)

var (
scope = promutils.NewScope("test_sandbox_processor")
notificationsConfig = runtimeInterfaces.NotificationsConfig{
Type: "sandbox",
}
)

func TestGetEmailer(t *testing.T) {
defer func() { r := recover(); assert.NotNil(t, r) }()
cfg := runtimeInterfaces.NotificationsConfig{
Expand All @@ -23,3 +31,13 @@ func TestGetEmailer(t *testing.T) {
// shouldn't reach here
t.Errorf("did not panic")
}

func TestNewNotificationsProcessor(t *testing.T) {
testSandboxProcessor := NewNotificationsProcessor(notificationsConfig, scope)
assert.IsType(t, testSandboxProcessor, &implementations.SandboxProcessor{})
}

func TestNewNotificationPublisher(t *testing.T) {
testSandboxPublisher := NewNotificationsPublisher(notificationsConfig, scope)
assert.IsType(t, testSandboxPublisher, &implementations.SandboxPublisher{})
}

0 comments on commit 45b050e

Please sign in to comment.