Skip to content

Commit 6934c92

Browse files
committed
Replace path of mock Slack URL with sample_slack_url
Signed-off-by: Aniruddh <aniruddh@purdue.edu>
1 parent 475d77d commit 6934c92

9 files changed

+19
-19
lines changed

notifications/notifications/src/test/kotlin/org/opensearch/integtest/IntegTestHelpers.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fun getCreateNotificationRequestJsonString(
116116
.joinToString("")
117117
val configObjectString = when (configType) {
118118
ConfigType.SLACK -> """
119-
"slack":{"url":"https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2#$randomString"}
119+
"slack":{"url":"https://hooks.slack.com/services/sample_slack_url#$randomString"}
120120
""".trimIndent()
121121
ConfigType.CHIME -> """
122122
"chime":{"url":"https://chime.domain.com/sample_chime_url#$randomString"}

notifications/notifications/src/test/kotlin/org/opensearch/integtest/SecurityNotificationIT.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class SecurityNotificationIT : PluginRestTestCase() {
5454
createUserWithCustomRole(user, password, NOTIFICATION_CREATE_CONFIG_ACCESS, "", ROLE_TO_PERMISSION_MAPPING[NOTIFICATION_CREATE_CONFIG_ACCESS])
5555

5656
// Create sample config request reference
57-
val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2")
57+
val sampleSlack = Slack("https://hooks.slack.com/services/sample_slack_url")
5858
val referenceObject = NotificationConfig(
5959
"this is a sample config name",
6060
"this is a sample config description",
@@ -97,7 +97,7 @@ class SecurityNotificationIT : PluginRestTestCase() {
9797
createUserWithCustomRole(user, password, NOTIFICATION_NO_ACCESS_ROLE, "", ROLE_TO_PERMISSION_MAPPING[NOTIFICATION_NO_ACCESS_ROLE])
9898

9999
// Create sample config request reference
100-
val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2")
100+
val sampleSlack = Slack("https://hooks.slack.com/services/sample_slack_url")
101101
val referenceObject = NotificationConfig(
102102
"this is a sample config name",
103103
"this is a sample config description",
@@ -133,7 +133,7 @@ class SecurityNotificationIT : PluginRestTestCase() {
133133
createUserWithCustomRole(user, password, NOTIFICATION_UPDATE_CONFIG_ACCESS, "", ROLE_TO_PERMISSION_MAPPING[NOTIFICATION_UPDATE_CONFIG_ACCESS])
134134

135135
// Create sample config request reference
136-
val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2")
136+
val sampleSlack = Slack("https://hooks.slack.com/services/sample_slack_url")
137137
val referenceObject = NotificationConfig(
138138
"this is a sample config name",
139139
"this is a sample config description",
@@ -210,7 +210,7 @@ class SecurityNotificationIT : PluginRestTestCase() {
210210
createUserWithCustomRole(user, password, NOTIFICATION_NO_ACCESS_ROLE, "", ROLE_TO_PERMISSION_MAPPING[NOTIFICATION_NO_ACCESS_ROLE])
211211

212212
// Create sample config request reference
213-
val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2")
213+
val sampleSlack = Slack("https://hooks.slack.com/services/sample_slack_url")
214214
val referenceObject = NotificationConfig(
215215
"this is a sample config name",
216216
"this is a sample config description",
@@ -246,7 +246,7 @@ class SecurityNotificationIT : PluginRestTestCase() {
246246
createUserWithCustomRole(user, password, NOTIFICATION_GET_CONFIG_ACCESS, "", ROLE_TO_PERMISSION_MAPPING[NOTIFICATION_GET_CONFIG_ACCESS])
247247

248248
// Create sample config request reference
249-
val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2")
249+
val sampleSlack = Slack("https://hooks.slack.com/services/sample_slack_url")
250250
val referenceObject = NotificationConfig(
251251
"this is a sample config name",
252252
"this is a sample config description",
@@ -302,7 +302,7 @@ class SecurityNotificationIT : PluginRestTestCase() {
302302
createUserWithCustomRole(user, password, NOTIFICATION_DELETE_CONFIG_ACCESS, "", ROLE_TO_PERMISSION_MAPPING[NOTIFICATION_DELETE_CONFIG_ACCESS])
303303

304304
// Create sample config request reference
305-
val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2")
305+
val sampleSlack = Slack("https://hooks.slack.com/services/sample_slack_url")
306306
val referenceObject = NotificationConfig(
307307
"this is a sample config name",
308308
"this is a sample config description",

notifications/notifications/src/test/kotlin/org/opensearch/integtest/bwc/NotificationsBackwardsCompatibilityIT.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class NotificationsBackwardsCompatibilityIT : PluginRestTestCase() {
103103
"description": "This is a sample config description $configId",
104104
"config_type": "slack",
105105
"is_enabled": true,
106-
"slack": { "url": "https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2#$configId" }
106+
"slack": { "url": "https://hooks.slack.com/services/sample_slack_url#$configId" }
107107
}
108108
}
109109
""".trimIndent()

notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/ChimeNotificationConfigCrudIT.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class ChimeNotificationConfigCrudIT : PluginRestTestCase() {
142142
"description":"${referenceObject.description}",
143143
"config_type":"chime",
144144
"is_enabled":${referenceObject.isEnabled},
145-
"slack":{"url":"https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2"}
145+
"slack":{"url":"https://hooks.slack.com/services/sample_slack_url"}
146146
"chime":{"url":"${(referenceObject.configData as Chime).url}"}
147147
}
148148
}
@@ -190,7 +190,7 @@ class ChimeNotificationConfigCrudIT : PluginRestTestCase() {
190190
"description":"this is a updated config description",
191191
"config_type":"slack",
192192
"is_enabled":"true",
193-
"slack":{"url":"https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2"}
193+
"slack":{"url":"https://hooks.slack.com/services/sample_slack_url"}
194194
}
195195
}
196196
""".trimIndent()

notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/CreateNotificationConfigIT.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CreateNotificationConfigIT : PluginRestTestCase() {
2727

2828
fun `test Create slack notification config`() {
2929
// Create sample config request reference
30-
val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2")
30+
val sampleSlack = Slack("https://hooks.slack.com/services/sample_slack_url")
3131
val referenceObject = NotificationConfig(
3232
"this is a sample config name",
3333
"this is a sample config description",

notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/EmailNotificationConfigCrudIT.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ class EmailNotificationConfigCrudIT : PluginRestTestCase() {
907907
"description":"${smtpAccountConfig.description}",
908908
"config_type":"smtp_account",
909909
"is_enabled":${smtpAccountConfig.isEnabled},
910-
"slack": {"url": "https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2"},
910+
"slack": {"url": "https://hooks.slack.com/services/sample_slack_url"},
911911
"smtp_account":{
912912
"host":"${sampleSmtpAccount.host}",
913913
"port":"${sampleSmtpAccount.port}",
@@ -948,7 +948,7 @@ class EmailNotificationConfigCrudIT : PluginRestTestCase() {
948948
"description":"${emailConfig.description}",
949949
"config_type":"email",
950950
"is_enabled":${emailConfig.isEnabled},
951-
"slack":{"url": "https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2"},
951+
"slack":{"url": "https://hooks.slack.com/services/sample_slack_url"},
952952
"email":{
953953
"email_account_id":"${sampleEmail.emailAccountID}",
954954
"default_recipients":[

notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/SlackNotificationConfigCrudIT.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class SlackNotificationConfigCrudIT : PluginRestTestCase() {
1919

2020
fun `test Create, Get, Update, Delete slack notification config using REST client`() {
2121
// Create sample config request reference
22-
val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2")
22+
val sampleSlack = Slack("https://hooks.slack.com/services/sample_slack_url")
2323
val referenceObject = NotificationConfig(
2424
"this is a sample config name",
2525
"this is a sample config description",
@@ -67,7 +67,7 @@ class SlackNotificationConfigCrudIT : PluginRestTestCase() {
6767
Thread.sleep(100)
6868

6969
// Updated notification config object
70-
val updatedSlack = Slack("https://hooks.slack.com/services/A654321/B7654321/L2K9J4I6H9G5F3E2D8C2B7A4")
70+
val updatedSlack = Slack("https://hooks.slack.com/services/updated_slack_url")
7171
val updatedObject = NotificationConfig(
7272
"this is a updated config name",
7373
"this is a updated config description",
@@ -126,7 +126,7 @@ class SlackNotificationConfigCrudIT : PluginRestTestCase() {
126126

127127
fun `test Bad Request for multiple config data for Slack using REST Client`() {
128128
// Create sample config request reference
129-
val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2")
129+
val sampleSlack = Slack("https://hooks.slack.com/services/sample_slack_url")
130130
val referenceObject = NotificationConfig(
131131
"this is a sample config name",
132132
"this is a sample config description",

notifications/notifications/src/test/kotlin/org/opensearch/integtest/config/WebhookNotificationConfigCrudIT.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class WebhookNotificationConfigCrudIT : PluginRestTestCase() {
159159
"description":"${referenceObject.description}",
160160
"config_type":"webhook",
161161
"is_enabled":${referenceObject.isEnabled},
162-
"slack":{"url":"https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2"}
162+
"slack":{"url":"https://hooks.slack.com/services/sample_slack_url"}
163163
"webhook":{"url":"${(referenceObject.configData as Webhook).url}"}
164164
}
165165
}

notifications/notifications/src/test/kotlin/org/opensearch/notifications/model/NotificationConfigDocTests.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ internal class NotificationConfigDocTests {
2525
createdTimeMs,
2626
listOf("br1", "br2", "br3")
2727
)
28-
val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2")
28+
val sampleSlack = Slack("https://hooks.slack.com/services/sample_slack_url")
2929
val config = NotificationConfig(
3030
"name",
3131
"description",
@@ -47,7 +47,7 @@ internal class NotificationConfigDocTests {
4747
createdTimeMs,
4848
listOf("br1", "br2", "br3")
4949
)
50-
val sampleSlack = Slack("https://hooks.slack.com/services/A123456/B1234567/A1B2C3D4E5F6G7H8I9J0K1L2")
50+
val sampleSlack = Slack("https://hooks.slack.com/services/sample_slack_url")
5151
val config = NotificationConfig(
5252
"name",
5353
"description",

0 commit comments

Comments
 (0)