From 27f0a68a28afa8ed2f2deeb6dac0796c0c0a8ff3 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Fri, 29 Apr 2016 09:01:38 +0200 Subject: [PATCH] X-Pack Notification: Settings refactoring, removed 'service' The service part is now obsolete with moving to `xpack.notification`. Original commit: elastic/x-pack-elasticsearch@a7907f24a5c3e7593c9f76b064bd9e691a9442a3 --- .../messy/tests/HipChatServiceIT.java | 14 +++--- .../messy/tests/PagerDutyServiceIT.java | 2 +- .../messy/tests/SlackServiceIT.java | 2 +- .../email/InternalEmailService.java | 2 +- .../hipchat/InternalHipChatService.java | 2 +- .../pagerduty/InternalPagerDutyService.java | 2 +- .../slack/InternalSlackService.java | 2 +- .../email/EmailSecretsIntegrationTests.java | 6 +-- .../hipchat/InternalHipChatServiceTests.java | 50 +++++++++---------- .../org/elasticsearch/watcher/Watcher.java | 13 +++-- .../elasticsearch/watcher/WatcherModule.java | 3 -- .../org/elasticsearch/watcher/WatcherF.java | 18 +++---- .../actions/email/EmailAttachmentTests.java | 10 ++-- .../HistoryTemplateEmailMappingsTests.java | 10 ++-- .../WatcherSettingsFilterTests.java | 12 ++--- 15 files changed, 72 insertions(+), 76 deletions(-) diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/HipChatServiceIT.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/HipChatServiceIT.java index e7d9e2ecd46..5246e3c30a1 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/HipChatServiceIT.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/HipChatServiceIT.java @@ -72,18 +72,18 @@ public class HipChatServiceIT extends AbstractWatcherIntegrationTestCase { .put(super.nodeSettings(nodeOrdinal)) // this is for the `test-watcher-integration` group level integration in HipChat - .put("xpack.notification.hipchat.service.account.integration_account.profile", "integration") - .put("xpack.notification.hipchat.service.account.integration_account.auth_token", + .put("xpack.notification.hipchat.account.integration_account.profile", "integration") + .put("xpack.notification.hipchat.account.integration_account.auth_token", "huuS9v7ccuOy3ZBWWWr1vt8Lqu3sQnLUE81nrLZU") - .put("xpack.notification.hipchat.service.account.integration_account.room", "test-watcher") + .put("xpack.notification.hipchat.account.integration_account.room", "test-watcher") // this is for the Watcher Test account in HipChat - .put("xpack.notification.hipchat.service.account.user_account.profile", "user") - .put("xpack.notification.hipchat.service.account.user_account.auth_token", "FYVx16oDH78ZW9r13wtXbcszyoyA7oX5tiMWg9X0") + .put("xpack.notification.hipchat.account.user_account.profile", "user") + .put("xpack.notification.hipchat.account.user_account.auth_token", "FYVx16oDH78ZW9r13wtXbcszyoyA7oX5tiMWg9X0") // this is for the `test-watcher-v1` notification token - .put("xpack.notification.hipchat.service.account.v1_account.profile", "v1") - .put("xpack.notification.hipchat.service.account.v1_account.auth_token", "a734baf62df618b96dda55b323fc30") + .put("xpack.notification.hipchat.account.v1_account.profile", "v1") + .put("xpack.notification.hipchat.account.v1_account.auth_token", "a734baf62df618b96dda55b323fc30") .build(); } diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/PagerDutyServiceIT.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/PagerDutyServiceIT.java index c06cada5c70..8ad5c808502 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/PagerDutyServiceIT.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/PagerDutyServiceIT.java @@ -72,7 +72,7 @@ public class PagerDutyServiceIT extends AbstractWatcherIntegrationTestCase { protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put("xpack.notification.pagerduty.service.account.test_account.service_api_key", "fc082467005d4072a914e0bb041882d0") + .put("xpack.notification.pagerduty.account.test_account.service_api_key", "fc082467005d4072a914e0bb041882d0") .build(); } diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SlackServiceIT.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SlackServiceIT.java index 1b673eb93ec..423e638b5fb 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SlackServiceIT.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SlackServiceIT.java @@ -71,7 +71,7 @@ public class SlackServiceIT extends AbstractWatcherIntegrationTestCase { .put(super.nodeSettings(nodeOrdinal)) // this is for the `test-watcher-integration` group level integration in HipChat - .put("xpack.notification.slack.service.account.test_account.url", + .put("xpack.notification.slack.account.test_account.url", "https://hooks.slack.com/services/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") .build(); } diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/email/InternalEmailService.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/email/InternalEmailService.java index 75eefd140ff..7d5acbb20af 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/email/InternalEmailService.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/email/InternalEmailService.java @@ -23,7 +23,7 @@ public class InternalEmailService extends AbstractLifecycleComponent EMAIL_ACCOUNT_SETTING = - Setting.groupSetting("xpack.notification.email.service.", Setting.Property.Dynamic, Setting.Property.NodeScope); + Setting.groupSetting("xpack.notification.email.", Setting.Property.Dynamic, Setting.Property.NodeScope); private volatile Accounts accounts; diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/InternalHipChatService.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/InternalHipChatService.java index d63b230968d..9ff41e22418 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/InternalHipChatService.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/hipchat/InternalHipChatService.java @@ -20,7 +20,7 @@ public class InternalHipChatService extends AbstractLifecycleComponent HIPCHAT_ACCOUNT_SETTING = - Setting.groupSetting("xpack.notification.hipchat.service.", Setting.Property.Dynamic, Setting.Property.NodeScope); + Setting.groupSetting("xpack.notification.hipchat.", Setting.Property.Dynamic, Setting.Property.NodeScope); @Inject public InternalHipChatService(Settings settings, HttpClient httpClient, ClusterSettings clusterSettings) { diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/pagerduty/InternalPagerDutyService.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/pagerduty/InternalPagerDutyService.java index 090fc987220..874463497fb 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/pagerduty/InternalPagerDutyService.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/pagerduty/InternalPagerDutyService.java @@ -18,7 +18,7 @@ import org.elasticsearch.watcher.support.http.HttpClient; public class InternalPagerDutyService extends AbstractLifecycleComponent implements PagerDutyService { public static final Setting PAGERDUTY_ACCOUNT_SETTING = - Setting.groupSetting("xpack.notification.pagerduty.service.", Setting.Property.Dynamic, Setting.Property.NodeScope); + Setting.groupSetting("xpack.notification.pagerduty.", Setting.Property.Dynamic, Setting.Property.NodeScope); private final HttpClient httpClient; private volatile PagerDutyAccounts accounts; diff --git a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/slack/InternalSlackService.java b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/slack/InternalSlackService.java index bee52adda74..b431b6e7c8c 100644 --- a/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/slack/InternalSlackService.java +++ b/elasticsearch/x-pack/src/main/java/org/elasticsearch/xpack/notification/slack/InternalSlackService.java @@ -19,7 +19,7 @@ public class InternalSlackService extends AbstractLifecycleComponent SLACK_ACCOUNT_SETTING = - Setting.groupSetting("xpack.notification.slack.service.", Setting.Property.Dynamic, Setting.Property.NodeScope); + Setting.groupSetting("xpack.notification.slack.", Setting.Property.Dynamic, Setting.Property.NodeScope); private volatile SlackAccounts accounts; @Inject diff --git a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/notification/email/EmailSecretsIntegrationTests.java b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/notification/email/EmailSecretsIntegrationTests.java index 9c6306916e2..7d24bd69bc2 100644 --- a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/notification/email/EmailSecretsIntegrationTests.java +++ b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/notification/email/EmailSecretsIntegrationTests.java @@ -66,9 +66,9 @@ public class EmailSecretsIntegrationTests extends AbstractWatcherIntegrationTest } return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put("xpack.notification.email.service.account.test.smtp.auth", true) - .put("xpack.notification.email.service.account.test.smtp.port", server.port()) - .put("xpack.notification.email.service.account.test.smtp.host", "localhost") + .put("xpack.notification.email.account.test.smtp.auth", true) + .put("xpack.notification.email.account.test.smtp.port", server.port()) + .put("xpack.notification.email.account.test.smtp.host", "localhost") .put("xpack.watcher.shield.encrypt_sensitive_data", encryptSensitiveData) .build(); } diff --git a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/notification/hipchat/InternalHipChatServiceTests.java b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/notification/hipchat/InternalHipChatServiceTests.java index 79d9b932628..50b1c73ad56 100644 --- a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/notification/hipchat/InternalHipChatServiceTests.java +++ b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/notification/hipchat/InternalHipChatServiceTests.java @@ -44,13 +44,13 @@ public class InternalHipChatServiceTests extends ESTestCase { HipChatMessage.Format defaultFormat = randomBoolean() ? null : randomFrom(HipChatMessage.Format.values()); Boolean defaultNotify = randomBoolean() ? null : (Boolean) randomBoolean(); Settings.Builder settingsBuilder = Settings.builder() - .put("xpack.notification.hipchat.service.account." + accountName + ".profile", HipChatAccount.Profile.V1.value()) - .put("xpack.notification.hipchat.service.account." + accountName + ".auth_token", "_token"); + .put("xpack.notification.hipchat.account." + accountName + ".profile", HipChatAccount.Profile.V1.value()) + .put("xpack.notification.hipchat.account." + accountName + ".auth_token", "_token"); if (host != null) { - settingsBuilder.put("xpack.notification.hipchat.service.account." + accountName + ".host", host); + settingsBuilder.put("xpack.notification.hipchat.account." + accountName + ".host", host); } if (port > 0) { - settingsBuilder.put("xpack.notification.hipchat.service.account." + accountName + ".port", port); + settingsBuilder.put("xpack.notification.hipchat.account." + accountName + ".port", port); } buildMessageDefaults(accountName, settingsBuilder, defaultRoom, null, defaultFrom, defaultColor, defaultFormat, defaultNotify); InternalHipChatService service = new InternalHipChatService(settingsBuilder.build(), httpClient, @@ -91,15 +91,15 @@ public class InternalHipChatServiceTests extends ESTestCase { HipChatMessage.Format defaultFormat = randomBoolean() ? null : randomFrom(HipChatMessage.Format.values()); Boolean defaultNotify = randomBoolean() ? null : (Boolean) randomBoolean(); Settings.Builder settingsBuilder = Settings.builder() - .put("xpack.notification.hipchat.service.account." + accountName + ".profile", + .put("xpack.notification.hipchat.account." + accountName + ".profile", HipChatAccount.Profile.INTEGRATION.value()) - .put("xpack.notification.hipchat.service.account." + accountName + ".auth_token", "_token") - .put("xpack.notification.hipchat.service.account." + accountName + ".room", room); + .put("xpack.notification.hipchat.account." + accountName + ".auth_token", "_token") + .put("xpack.notification.hipchat.account." + accountName + ".room", room); if (host != null) { - settingsBuilder.put("xpack.notification.hipchat.service.account." + accountName + ".host", host); + settingsBuilder.put("xpack.notification.hipchat.account." + accountName + ".host", host); } if (port > 0) { - settingsBuilder.put("xpack.notification.hipchat.service.account." + accountName + ".port", port); + settingsBuilder.put("xpack.notification.hipchat.account." + accountName + ".port", port); } buildMessageDefaults(accountName, settingsBuilder, null, null, defaultFrom, defaultColor, defaultFormat, defaultNotify); InternalHipChatService service = new InternalHipChatService(settingsBuilder.build(), httpClient, @@ -128,9 +128,9 @@ public class InternalHipChatServiceTests extends ESTestCase { public void testSingleAccountIntegrationNoRoomSetting() throws Exception { String accountName = randomAsciiOfLength(10); Settings.Builder settingsBuilder = Settings.builder() - .put("xpack.notification.hipchat.service.account." + accountName + ".profile", + .put("xpack.notification.hipchat.account." + accountName + ".profile", HipChatAccount.Profile.INTEGRATION.value()) - .put("xpack.notification.hipchat.service.account." + accountName + ".auth_token", "_token"); + .put("xpack.notification.hipchat.account." + accountName + ".auth_token", "_token"); try (InternalHipChatService service = new InternalHipChatService(settingsBuilder.build(), httpClient, new ClusterSettings(settingsBuilder.build(), Collections.singleton(InternalHipChatService.HIPCHAT_ACCOUNT_SETTING)))) { service.start(); @@ -150,13 +150,13 @@ public class InternalHipChatServiceTests extends ESTestCase { HipChatMessage.Format defaultFormat = randomBoolean() ? null : randomFrom(HipChatMessage.Format.values()); Boolean defaultNotify = randomBoolean() ? null : (Boolean) randomBoolean(); Settings.Builder settingsBuilder = Settings.builder() - .put("xpack.notification.hipchat.service.account." + accountName + ".profile", HipChatAccount.Profile.USER.value()) - .put("xpack.notification.hipchat.service.account." + accountName + ".auth_token", "_token"); + .put("xpack.notification.hipchat.account." + accountName + ".profile", HipChatAccount.Profile.USER.value()) + .put("xpack.notification.hipchat.account." + accountName + ".auth_token", "_token"); if (host != null) { - settingsBuilder.put("xpack.notification.hipchat.service.account." + accountName + ".host", host); + settingsBuilder.put("xpack.notification.hipchat.account." + accountName + ".host", host); } if (port > 0) { - settingsBuilder.put("xpack.notification.hipchat.service.account." + accountName + ".port", port); + settingsBuilder.put("xpack.notification.hipchat.account." + accountName + ".port", port); } buildMessageDefaults(accountName, settingsBuilder, defaultRoom, defaultUser, null, defaultColor, defaultFormat, defaultNotify); InternalHipChatService service = new InternalHipChatService(settingsBuilder.build(), httpClient, @@ -197,17 +197,17 @@ public class InternalHipChatServiceTests extends ESTestCase { Boolean defaultNotify = randomBoolean() ? null : (Boolean) randomBoolean(); Settings.Builder settingsBuilder = Settings.builder(); String defaultAccount = "_a" + randomIntBetween(0, 4); - settingsBuilder.put("xpack.notification.hipchat.service.default_account", defaultAccount); + settingsBuilder.put("xpack.notification.hipchat.default_account", defaultAccount); boolean customGlobalServer = randomBoolean(); if (customGlobalServer) { - settingsBuilder.put("xpack.notification.hipchat.service.host", "_host_global"); - settingsBuilder.put("xpack.notification.hipchat.service.port", 299); + settingsBuilder.put("xpack.notification.hipchat.host", "_host_global"); + settingsBuilder.put("xpack.notification.hipchat.port", 299); } for (int i = 0; i < 5; i++) { String name = "_a" + i; - String prefix = "xpack.notification.hipchat.service.account." + name; + String prefix = "xpack.notification.hipchat.account." + name; HipChatAccount.Profile profile = randomFrom(HipChatAccount.Profile.values()); settingsBuilder.put(prefix + ".profile", profile); settingsBuilder.put(prefix + ".auth_token", "_token" + i); @@ -256,22 +256,22 @@ public class InternalHipChatServiceTests extends ESTestCase { private void buildMessageDefaults(String account, Settings.Builder settingsBuilder, String room, String user, String from, HipChatMessage.Color color, HipChatMessage.Format format, Boolean notify) { if (room != null) { - settingsBuilder.put("xpack.notification.hipchat.service.account." + account + ".message_defaults.room", room); + settingsBuilder.put("xpack.notification.hipchat.account." + account + ".message_defaults.room", room); } if (user != null) { - settingsBuilder.put("xpack.notification.hipchat.service.account." + account + ".message_defaults.user", user); + settingsBuilder.put("xpack.notification.hipchat.account." + account + ".message_defaults.user", user); } if (from != null) { - settingsBuilder.put("xpack.notification.hipchat.service.account." + account + ".message_defaults.from", from); + settingsBuilder.put("xpack.notification.hipchat.account." + account + ".message_defaults.from", from); } if (color != null) { - settingsBuilder.put("xpack.notification.hipchat.service.account." + account + ".message_defaults.color", color.value()); + settingsBuilder.put("xpack.notification.hipchat.account." + account + ".message_defaults.color", color.value()); } if (format != null) { - settingsBuilder.put("xpack.notification.hipchat.service.account." + account + ".message_defaults.format", format); + settingsBuilder.put("xpack.notification.hipchat.account." + account + ".message_defaults.format", format); } if (notify != null) { - settingsBuilder.put("xpack.notification.hipchat.service.account." + account + ".message_defaults.notify", notify); + settingsBuilder.put("xpack.notification.hipchat.account." + account + ".message_defaults.notify", notify); } } } diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/Watcher.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/Watcher.java index 996c98b5aec..8f504fb0f2e 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/Watcher.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/Watcher.java @@ -183,7 +183,6 @@ public class Watcher { module.registerSetting(Setting.boolSetting(XPackPlugin.featureEnabledSetting(Watcher.NAME), true, Setting.Property.NodeScope)); module.registerSetting(SecretService.Secure.ENCRYPT_SENSITIVE_DATA_SETTING); - // TODO add real settings for these module.registerSetting(Setting.simpleString("xpack.watcher.internal.ops.search.default_timeout", Setting.Property.NodeScope)); module.registerSetting(Setting.simpleString("xpack.watcher.internal.ops.bulk.default_timeout", Setting.Property.NodeScope)); module.registerSetting(Setting.simpleString("xpack.watcher.internal.ops.index.default_timeout", Setting.Property.NodeScope)); @@ -201,12 +200,12 @@ public class Watcher { module.registerSetting(Setting.simpleString("xpack.watcher.start_immediately", Setting.Property.NodeScope)); module.registerSetting(Setting.simpleString("xpack.watcher.http.default_connection_timeout", Setting.Property.NodeScope)); - module.registerSettingsFilter("xpack.notification.email.service.account.*.smtp.password"); - module.registerSettingsFilter("xpack.notification.slack.service.account.*.url"); - module.registerSettingsFilter("xpack.notification.pagerduty.service.account.*.url"); - module.registerSettingsFilter("xpack.notification.pagerduty.service." + PagerDutyAccount.SERVICE_KEY_SETTING); - module.registerSettingsFilter("xpack.notification.pagerduty.service.account.*." + PagerDutyAccount.SERVICE_KEY_SETTING); - module.registerSettingsFilter("xpack.notification.hipchat.service.account.*.auth_token"); + module.registerSettingsFilter("xpack.notification.email.account.*.smtp.password"); + module.registerSettingsFilter("xpack.notification.slack.account.*.url"); + module.registerSettingsFilter("xpack.notification.pagerduty.account.*.url"); + module.registerSettingsFilter("xpack.notification.pagerduty." + PagerDutyAccount.SERVICE_KEY_SETTING); + module.registerSettingsFilter("xpack.notification.pagerduty.account.*." + PagerDutyAccount.SERVICE_KEY_SETTING); + module.registerSettingsFilter("xpack.notification.hipchat.account.*.auth_token"); } public void onModule(NetworkModule module) { diff --git a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/WatcherModule.java b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/WatcherModule.java index 2367d082912..bcfb6c5d07c 100644 --- a/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/WatcherModule.java +++ b/elasticsearch/x-pack/watcher/src/main/java/org/elasticsearch/watcher/WatcherModule.java @@ -7,10 +7,7 @@ package org.elasticsearch.watcher; import org.elasticsearch.common.inject.AbstractModule; -import org.elasticsearch.common.inject.multibindings.Multibinder; import org.elasticsearch.common.inject.util.Providers; -import org.elasticsearch.common.settings.Setting; -import org.elasticsearch.common.settings.Settings; import org.elasticsearch.watcher.support.WatcherIndexTemplateRegistry; import org.elasticsearch.watcher.support.validation.WatcherSettingsValidation; import org.elasticsearch.xpack.XPackPlugin; diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/WatcherF.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/WatcherF.java index 3f026f145b3..35b38e03b54 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/WatcherF.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/WatcherF.java @@ -38,23 +38,23 @@ public class WatcherF { settings.put("cluster.name", WatcherF.class.getSimpleName()); // this is for the `test-watcher-integration` group level integration in HipChat - settings.put("xpack.notification.hipchat.service.account.integration.profile", "integration"); - settings.put("xpack.notification.hipchat.service.account.integration.auth_token", "huuS9v7ccuOy3ZBWWWr1vt8Lqu3sQnLUE81nrLZU"); - settings.put("xpack.notification.hipchat.service.account.integration.room", "test-watcher"); + settings.put("xpack.notification.hipchat.account.integration.profile", "integration"); + settings.put("xpack.notification.hipchat.account.integration.auth_token", "huuS9v7ccuOy3ZBWWWr1vt8Lqu3sQnLUE81nrLZU"); + settings.put("xpack.notification.hipchat.account.integration.room", "test-watcher"); // this is for the Watcher Test account in HipChat - settings.put("xpack.notification.hipchat.service.account.user.profile", "user"); - settings.put("xpack.notification.hipchat.service.account.user.auth_token", "FYVx16oDH78ZW9r13wtXbcszyoyA7oX5tiMWg9X0"); + settings.put("xpack.notification.hipchat.account.user.profile", "user"); + settings.put("xpack.notification.hipchat.account.user.auth_token", "FYVx16oDH78ZW9r13wtXbcszyoyA7oX5tiMWg9X0"); // this is for the `test-watcher-v1` notification token (hipchat) - settings.put("xpack.notification.hipchat.service.account.v1.profile", "v1"); - settings.put("xpack.notification.hipchat.service.account.v1.auth_token", "a734baf62df618b96dda55b323fc30"); + settings.put("xpack.notification.hipchat.account.v1.profile", "v1"); + settings.put("xpack.notification.hipchat.account.v1.auth_token", "a734baf62df618b96dda55b323fc30"); // this is for our test slack incoming webhook (under elasticsearch team) - System.setProperty("es.xpack.notification.slack.service.account.a1.url", + System.setProperty("es.xpack.notification.slack.account.a1.url", "https://hooks.slack.com/services/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"); - System.setProperty("es.xpack.notification.pagerduty.service.account.service1.service_api_key", + System.setProperty("es.xpack.notification.pagerduty.account.service1.service_api_key", "fc082467005d4072a914e0bb041882d0"); final CountDownLatch latch = new CountDownLatch(1); diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/actions/email/EmailAttachmentTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/actions/email/EmailAttachmentTests.java index 93c3c96a47d..f3d0ca41df4 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/actions/email/EmailAttachmentTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/actions/email/EmailAttachmentTests.java @@ -93,11 +93,11 @@ public class EmailAttachmentTests extends AbstractWatcherIntegrationTestCase { } return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put("xpack.notification.email.service.account.test.smtp.auth", true) - .put("xpack.notification.email.service.account.test.smtp.user", USERNAME) - .put("xpack.notification.email.service.account.test.smtp.password", PASSWORD) - .put("xpack.notification.email.service.account.test.smtp.port", server.port()) - .put("xpack.notification.email.service.account.test.smtp.host", "localhost") + .put("xpack.notification.email.account.test.smtp.auth", true) + .put("xpack.notification.email.account.test.smtp.user", USERNAME) + .put("xpack.notification.email.account.test.smtp.password", PASSWORD) + .put("xpack.notification.email.account.test.smtp.port", server.port()) + .put("xpack.notification.email.account.test.smtp.host", "localhost") .build(); } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/history/HistoryTemplateEmailMappingsTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/history/HistoryTemplateEmailMappingsTests.java index 1723ebf5fcd..ee2c2eb5710 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/history/HistoryTemplateEmailMappingsTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/history/HistoryTemplateEmailMappingsTests.java @@ -62,11 +62,11 @@ public class HistoryTemplateEmailMappingsTests extends AbstractWatcherIntegratio .put(super.nodeSettings(nodeOrdinal)) // email - .put("xpack.notification.email.service.account.test.smtp.auth", true) - .put("xpack.notification.email.service.account.test.smtp.user", USERNAME) - .put("xpack.notification.email.service.account.test.smtp.password", PASSWORD) - .put("xpack.notification.email.service.account.test.smtp.port", server.port()) - .put("xpack.notification.email.service.account.test.smtp.host", "localhost") + .put("xpack.notification.email.account.test.smtp.auth", true) + .put("xpack.notification.email.account.test.smtp.user", USERNAME) + .put("xpack.notification.email.account.test.smtp.password", PASSWORD) + .put("xpack.notification.email.account.test.smtp.port", server.port()) + .put("xpack.notification.email.account.test.smtp.host", "localhost") .build(); } diff --git a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatcherSettingsFilterTests.java b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatcherSettingsFilterTests.java index 1d0e312a725..90760bb74dc 100644 --- a/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatcherSettingsFilterTests.java +++ b/elasticsearch/x-pack/watcher/src/test/java/org/elasticsearch/watcher/test/integration/WatcherSettingsFilterTests.java @@ -44,10 +44,10 @@ public class WatcherSettingsFilterTests extends AbstractWatcherIntegrationTestCa return Settings.builder() .put(super.nodeSettings(nodeOrdinal)) .put(NetworkModule.HTTP_ENABLED.getKey(), true) - .put("xpack.notification.email.service.account._email.smtp.host", "host.domain") - .put("xpack.notification.email.service.account._email.smtp.port", 587) - .put("xpack.notification.email.service.account._email.smtp.user", "_user") - .put("xpack.notification.email.service.account._email.smtp.password", "_passwd") + .put("xpack.notification.email.account._email.smtp.host", "host.domain") + .put("xpack.notification.email.account._email.smtp.port", 587) + .put("xpack.notification.email.account._email.smtp.user", "_user") + .put("xpack.notification.email.account._email.smtp.password", "_passwd") .build(); } @@ -57,9 +57,9 @@ public class WatcherSettingsFilterTests extends AbstractWatcherIntegrationTestCa Map nodes = (Map) response.get("nodes"); for (Object node : nodes.values()) { Map settings = (Map) ((Map) node).get("settings"); - assertThat(XContentMapValues.extractValue("xpack.notification.email.service.account._email.smtp.user", settings), + assertThat(XContentMapValues.extractValue("xpack.notification.email.account._email.smtp.user", settings), is((Object) "_user")); - assertThat(XContentMapValues.extractValue("xpack.notification.email.service.account._email.smtp.password", settings), + assertThat(XContentMapValues.extractValue("xpack.notification.email.account._email.smtp.password", settings), nullValue()); } }