From eb69e60765993bafaad6cea2d7c45a4882c491b3 Mon Sep 17 00:00:00 2001 From: Aniruddh Srivastava Date: Sat, 11 Nov 2023 03:13:21 -0500 Subject: [PATCH] Replaced more wrongly formatted dummy Slack URL with properly formatted dummy Slack URL Signed-off-by: Aniruddh Srivastava --- .../org/opensearch/integtest/IntegTestHelpers.kt | 2 +- .../opensearch/integtest/SecurityNotificationIT.kt | 12 ++++++------ .../config/ChimeNotificationConfigCrudIT.kt | 2 +- .../config/EmailNotificationConfigCrudIT.kt | 4 ++-- .../model/NotificationConfigDocTests.kt | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/notifications/notifications/src/test/kotlin/org/opensearch/integtest/IntegTestHelpers.kt b/notifications/notifications/src/test/kotlin/org/opensearch/integtest/IntegTestHelpers.kt index fefc8a61..45bf01ac 100644 --- a/notifications/notifications/src/test/kotlin/org/opensearch/integtest/IntegTestHelpers.kt +++ b/notifications/notifications/src/test/kotlin/org/opensearch/integtest/IntegTestHelpers.kt @@ -116,7 +116,7 @@ fun getCreateNotificationRequestJsonString( .joinToString("") val configObjectString = when (configType) { ConfigType.SLACK -> """ - "slack":{"url":"https://slack.domain.com/sample_slack_url#$randomString"} + "slack":{"url":"https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2#$randomString"} """.trimIndent() ConfigType.CHIME -> """ "chime":{"url":"https://chime.domain.com/sample_chime_url#$randomString"} diff --git a/notifications/notifications/src/test/kotlin/org/opensearch/integtest/SecurityNotificationIT.kt b/notifications/notifications/src/test/kotlin/org/opensearch/integtest/SecurityNotificationIT.kt index e2d89769..ac35771b 100644 --- a/notifications/notifications/src/test/kotlin/org/opensearch/integtest/SecurityNotificationIT.kt +++ b/notifications/notifications/src/test/kotlin/org/opensearch/integtest/SecurityNotificationIT.kt @@ -54,7 +54,7 @@ class SecurityNotificationIT : PluginRestTestCase() { createUserWithCustomRole(user, password, NOTIFICATION_CREATE_CONFIG_ACCESS, "", ROLE_TO_PERMISSION_MAPPING[NOTIFICATION_CREATE_CONFIG_ACCESS]) // Create sample config request reference - val sampleSlack = Slack("https://domain.com/sample_slack_url#1234567890") + val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2") val referenceObject = NotificationConfig( "this is a sample config name", "this is a sample config description", @@ -97,7 +97,7 @@ class SecurityNotificationIT : PluginRestTestCase() { createUserWithCustomRole(user, password, NOTIFICATION_NO_ACCESS_ROLE, "", ROLE_TO_PERMISSION_MAPPING[NOTIFICATION_NO_ACCESS_ROLE]) // Create sample config request reference - val sampleSlack = Slack("https://domain.com/sample_slack_url#1234567890") + val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2") val referenceObject = NotificationConfig( "this is a sample config name", "this is a sample config description", @@ -133,7 +133,7 @@ class SecurityNotificationIT : PluginRestTestCase() { createUserWithCustomRole(user, password, NOTIFICATION_UPDATE_CONFIG_ACCESS, "", ROLE_TO_PERMISSION_MAPPING[NOTIFICATION_UPDATE_CONFIG_ACCESS]) // Create sample config request reference - val sampleSlack = Slack("https://domain.com/sample_slack_url#1234567890") + val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2") val referenceObject = NotificationConfig( "this is a sample config name", "this is a sample config description", @@ -210,7 +210,7 @@ class SecurityNotificationIT : PluginRestTestCase() { createUserWithCustomRole(user, password, NOTIFICATION_NO_ACCESS_ROLE, "", ROLE_TO_PERMISSION_MAPPING[NOTIFICATION_NO_ACCESS_ROLE]) // Create sample config request reference - val sampleSlack = Slack("https://domain.com/sample_slack_url#1234567890") + val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2") val referenceObject = NotificationConfig( "this is a sample config name", "this is a sample config description", @@ -246,7 +246,7 @@ class SecurityNotificationIT : PluginRestTestCase() { createUserWithCustomRole(user, password, NOTIFICATION_GET_CONFIG_ACCESS, "", ROLE_TO_PERMISSION_MAPPING[NOTIFICATION_GET_CONFIG_ACCESS]) // Create sample config request reference - val sampleSlack = Slack("https://domain.com/sample_slack_url#1234567890") + val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2") val referenceObject = NotificationConfig( "this is a sample config name", "this is a sample config description", @@ -302,7 +302,7 @@ class SecurityNotificationIT : PluginRestTestCase() { createUserWithCustomRole(user, password, NOTIFICATION_DELETE_CONFIG_ACCESS, "", ROLE_TO_PERMISSION_MAPPING[NOTIFICATION_DELETE_CONFIG_ACCESS]) // Create sample config request reference - val sampleSlack = Slack("https://domain.com/sample_slack_url#1234567890") + val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2") val referenceObject = NotificationConfig( "this is a sample config name", "this is a sample config description", diff --git a/notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/ChimeNotificationConfigCrudIT.kt b/notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/ChimeNotificationConfigCrudIT.kt index 6b6d17e0..bb41ea02 100644 --- a/notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/ChimeNotificationConfigCrudIT.kt +++ b/notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/ChimeNotificationConfigCrudIT.kt @@ -142,7 +142,7 @@ class ChimeNotificationConfigCrudIT : PluginRestTestCase() { "description":"${referenceObject.description}", "config_type":"chime", "is_enabled":${referenceObject.isEnabled}, - "slack":{"url":"https://dummy.com"} + "slack":{"url":"https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2"} "chime":{"url":"${(referenceObject.configData as Chime).url}"} } } diff --git a/notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/EmailNotificationConfigCrudIT.kt b/notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/EmailNotificationConfigCrudIT.kt index aed06e9f..fcb599a7 100644 --- a/notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/EmailNotificationConfigCrudIT.kt +++ b/notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/EmailNotificationConfigCrudIT.kt @@ -907,7 +907,7 @@ class EmailNotificationConfigCrudIT : PluginRestTestCase() { "description":"${smtpAccountConfig.description}", "config_type":"smtp_account", "is_enabled":${smtpAccountConfig.isEnabled}, - "slack": {"url": "https://dummy.com"}, + "slack": {"url": "https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2"}, "smtp_account":{ "host":"${sampleSmtpAccount.host}", "port":"${sampleSmtpAccount.port}", @@ -948,7 +948,7 @@ class EmailNotificationConfigCrudIT : PluginRestTestCase() { "description":"${emailConfig.description}", "config_type":"email", "is_enabled":${emailConfig.isEnabled}, - "slack":{"url": "https://dummy.com"}, + "slack":{"url": "https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2"}, "email":{ "email_account_id":"${sampleEmail.emailAccountID}", "default_recipients":[ diff --git a/notifications/notifications/src/test/kotlin/org/opensearch/notifications/model/NotificationConfigDocTests.kt b/notifications/notifications/src/test/kotlin/org/opensearch/notifications/model/NotificationConfigDocTests.kt index 0f36945e..553499b0 100644 --- a/notifications/notifications/src/test/kotlin/org/opensearch/notifications/model/NotificationConfigDocTests.kt +++ b/notifications/notifications/src/test/kotlin/org/opensearch/notifications/model/NotificationConfigDocTests.kt @@ -25,7 +25,7 @@ internal class NotificationConfigDocTests { createdTimeMs, listOf("br1", "br2", "br3") ) - val sampleSlack = Slack("https://domain.com/sample_url#1234567890") + val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2") val config = NotificationConfig( "name", "description",