ensure transport is set for external cluster clients take 2

Original commit: elastic/x-pack-elasticsearch@b92943303e
This commit is contained in:
jaymode 2016-08-03 08:12:05 -04:00
parent 417bc49230
commit 00e963fef9
2 changed files with 6 additions and 2 deletions

View File

@ -13,6 +13,7 @@ import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.Response;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.metadata.IndexTemplateMetaData;
import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.plugins.Plugin;
@ -113,6 +114,7 @@ public class IndexAuditIT extends ESIntegTestCase {
protected Settings externalClusterClientSettings() {
return Settings.builder()
.put(Security.USER_SETTING.getKey(), USER + ":" + PASS)
.put(NetworkModule.TRANSPORT_TYPE_KEY, randomFrom("security3", "security4"))
.build();
}

View File

@ -10,10 +10,11 @@ import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.transport.MockTransportClient;
import org.elasticsearch.xpack.XPackTransportClient;
import org.elasticsearch.xpack.security.Security;
import org.elasticsearch.xpack.security.authc.support.SecuredString;
import org.elasticsearch.test.ESIntegTestCase;
@ -39,6 +40,7 @@ public class SecurityTransportClientIT extends ESIntegTestCase {
protected Settings externalClusterClientSettings() {
return Settings.builder()
.put(Security.USER_SETTING.getKey(), ADMIN_USER_PW)
.put(NetworkModule.TRANSPORT_TYPE_KEY, randomFrom("security3", "security4"))
.build();
}
@ -116,6 +118,6 @@ public class SecurityTransportClientIT extends ESIntegTestCase {
.put("cluster.name", clusterName)
.build();
return new MockTransportClient(settings, XPackPlugin.class).addTransportAddress(publishAddress);
return new XPackTransportClient(settings).addTransportAddress(publishAddress);
}
}