From 84574c0367011b5f66c4a767d4c89863cc7925ca Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Tue, 27 Jun 2017 14:52:37 -0700 Subject: [PATCH] Another fix for security tribe tests when ssl is disabled Original commit: elastic/x-pack-elasticsearch@db2eca35225e86f79b15ae6ef604d1e372fc5b7d --- .../xpack/security/SecurityTribeIT.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugin/src/test/java/org/elasticsearch/xpack/security/SecurityTribeIT.java b/plugin/src/test/java/org/elasticsearch/xpack/security/SecurityTribeIT.java index 1cdf39660e3..c89dbc2d605 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/security/SecurityTribeIT.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/security/SecurityTribeIT.java @@ -155,11 +155,13 @@ public class SecurityTribeIT extends NativeRealmIntegTestCase { MockSecureSettings secureSettingsTemplate = (MockSecureSettings) Settings.builder().put(cluster2SettingsSource.nodeSettings(0)).getSecureSettings(); MockSecureSettings secureSettings = new MockSecureSettings(); - for (String settingName : secureSettingsTemplate.getSettingNames()) { - String settingValue = secureSettingsTemplate.getString(settingName).toString(); - secureSettings.setString(settingName, settingValue); - secureSettings.setString("tribe.t1." + settingName, settingValue); - secureSettings.setString("tribe.t2." + settingName, settingValue); + if (secureSettingsTemplate != null) { + for (String settingName : secureSettingsTemplate.getSettingNames()) { + String settingValue = secureSettingsTemplate.getString(settingName).toString(); + secureSettings.setString(settingName, settingValue); + secureSettings.setString("tribe.t1." + settingName, settingValue); + secureSettings.setString("tribe.t2." + settingName, settingValue); + } } Settings merged = Settings.builder()