Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test create for email
Browse files Browse the repository at this point in the history
sfc-gh-asawicki committed Jan 24, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 92a24fb commit 399104b
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -80,6 +80,15 @@ func TestInt_NotificationIntegrations(t *testing.T) {
WithPushNotificationParams(sdk.NewPushNotificationParamsRequest().WithAzurePush(sdk.NewAzurePushRequest(azureEventGridTopicEndpoint, azureTenantId)))
}

createNotificationIntegrationEmailRequest := func(t *testing.T) *sdk.CreateNotificationIntegrationRequest {
t.Helper()
id := sdk.RandomAccountObjectIdentifier()

// TODO [SNOW-1007539]: use email of our service user
return sdk.NewCreateNotificationIntegrationRequest(id, true).
WithEmailParams(sdk.NewEmailParamsRequest().WithAllowedRecipients([]sdk.NotificationIntegrationAllowedRecipient{{Email: "[email protected]"}}))
}

createNotificationIntegrationWithRequest := func(t *testing.T, request *sdk.CreateNotificationIntegrationRequest) *sdk.NotificationIntegration {
t.Helper()
id := request.GetName()
@@ -183,7 +192,18 @@ func TestInt_NotificationIntegrations(t *testing.T) {
})

t.Run("create and describe notification integration - email", func(t *testing.T) {
// TODO: fill me
request := createNotificationIntegrationEmailRequest(t)

integration := createNotificationIntegrationWithRequest(t, request)

assertNotificationIntegration(t, integration, request.GetName(), "EMAIL", "")

details, err := client.NotificationIntegrations.Describe(ctx, integration.ID())
require.NoError(t, err)

assert.Contains(t, details, sdk.NotificationIntegrationProperty{Name: "ENABLED", Type: "Boolean", Value: "true", Default: "false"})
assert.Contains(t, details, sdk.NotificationIntegrationProperty{Name: "ALLOWED_RECIPIENTS", Type: "List", Value: "[email protected]", Default: "[]"})
assert.Contains(t, details, sdk.NotificationIntegrationProperty{Name: "COMMENT", Type: "String", Value: "", Default: ""})
})

t.Run("alter notification integration: auto", func(t *testing.T) {

0 comments on commit 399104b

Please sign in to comment.