[TEST] Set proper "transport.type" for transport client in IndexAuditTrailTests

Fixes issues seen on CI.

relates elastic/x-pack-elasticsearch#2115

Original commit: elastic/x-pack-elasticsearch@0094225a2e
This commit is contained in:
Yannick Welsch 2017-07-28 14:55:09 +02:00
parent f99838e1bf
commit 40174e4dcf
2 changed files with 14 additions and 3 deletions

View File

@ -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<Class<? extends Plugin>> nodePlugins() {
return Arrays.asList(xpackPluginClass(),

View File

@ -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);
}
}
};