diff --git a/plugin/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java b/plugin/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java index b612920d0c5..c5a538851d9 100644 --- a/plugin/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java +++ b/plugin/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java @@ -142,9 +142,7 @@ public class SecuritySettingsSource extends ClusterDiscoveryConfiguration.Unicas Settings superSettings = super.transportClientSettings(); Settings.Builder builder = Settings.builder().put(superSettings); addClientSSLSettings(builder, ""); - if (NetworkModule.TRANSPORT_TYPE_SETTING.exists(superSettings) == false) { - builder.put(NetworkModule.TRANSPORT_TYPE_SETTING.getKey(), Security.NAME4); - } + addDefaultSecurityTransportType(builder, superSettings); if (randomBoolean()) { builder.put(Security.USER_SETTING.getKey(), @@ -156,6 +154,12 @@ public class SecuritySettingsSource extends ClusterDiscoveryConfiguration.Unicas return builder.build(); } + protected void addDefaultSecurityTransportType(Settings.Builder builder, Settings settings) { + if (NetworkModule.TRANSPORT_TYPE_SETTING.exists(settings) == false) { + builder.put(NetworkModule.TRANSPORT_TYPE_SETTING.getKey(), Security.NAME4); + } + } + @Override public Collection> nodePlugins() { return Arrays.asList(xpackPluginClass(), diff --git a/plugin/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java b/plugin/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java index fe9d1d1c0b0..ac1411f4cbf 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrailTests.java @@ -165,6 +165,13 @@ public class IndexAuditTrailTests extends SecurityIntegTestCase { return builder.build(); } } + + @Override + protected void addDefaultSecurityTransportType(Settings.Builder builder, Settings settings) { + if (useSecurity) { + super.addDefaultSecurityTransportType(builder, settings); + } + } };