-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
92a24fb
commit 399104b
Showing
1 changed file
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
|