diff --git a/elasticsearch/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java b/elasticsearch/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java index ad9e034c607..b285d1c8874 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java +++ b/elasticsearch/src/test/java/org/elasticsearch/license/TribeTransportTestCase.java @@ -29,7 +29,7 @@ import org.elasticsearch.test.ESIntegTestCase.Scope; import org.elasticsearch.test.InternalTestCluster; import org.elasticsearch.test.NodeConfigurationSource; import org.elasticsearch.test.TestCluster; -import org.elasticsearch.test.discovery.MockZenPing; +import org.elasticsearch.test.discovery.TestZenDiscovery; import org.elasticsearch.transport.MockTcpTransportPlugin; import org.elasticsearch.xpack.XPackPlugin; import org.elasticsearch.xpack.XPackSettings; @@ -141,7 +141,7 @@ public abstract class TribeTransportTestCase extends ESIntegTestCase { .put("transport.type", MockTcpTransportPlugin.MOCK_TCP_TRANSPORT_NAME) .build(); - final List> mockPlugins = Arrays.asList(MockZenPing.TestPlugin.class, MockTcpTransportPlugin.class); + final List> mockPlugins = Arrays.asList(TestZenDiscovery.TestPlugin.class, MockTcpTransportPlugin.class); final Node tribeNode = new MockNode(merged, mockPlugins).start(); Client tribeClient = tribeNode.client(); diff --git a/elasticsearch/src/test/java/org/elasticsearch/transport/KnownActionsTests.java b/elasticsearch/src/test/java/org/elasticsearch/transport/KnownActionsTests.java index 7ee939e0a72..6b1e96f41df 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/transport/KnownActionsTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/transport/KnownActionsTests.java @@ -9,10 +9,12 @@ import org.apache.lucene.util.IOUtils; import org.elasticsearch.action.Action; import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.io.Streams; +import org.elasticsearch.common.settings.Settings; import org.elasticsearch.license.Licensing; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.SecurityIntegTestCase; +import org.elasticsearch.test.discovery.TestZenDiscovery; import org.elasticsearch.xpack.XPackPlugin; import org.elasticsearch.xpack.graph.Graph; import org.elasticsearch.xpack.security.action.SecurityActionModule; @@ -58,8 +60,9 @@ public class KnownActionsTests extends SecurityIntegTestCase { } @Override - protected boolean addMockZenPings() { - return false; // make sure unicasthost zen ping actions are loaded + protected Settings nodeSettings(int nodeOrdinal) { + return Settings.builder().put(super.nodeSettings(nodeOrdinal)) + .put(TestZenDiscovery.USE_MOCK_PINGS.getKey(), false).build(); } @BeforeClass diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/transport/ServerTransportFilterIntegrationTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/transport/ServerTransportFilterIntegrationTests.java index ad81aec4762..dcea74a3282 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/security/transport/ServerTransportFilterIntegrationTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/security/transport/ServerTransportFilterIntegrationTests.java @@ -5,6 +5,12 @@ */ package org.elasticsearch.xpack.security.transport; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; + import org.elasticsearch.common.network.NetworkAddress; import org.elasticsearch.common.network.NetworkModule; import org.elasticsearch.common.settings.Settings; @@ -15,7 +21,7 @@ import org.elasticsearch.node.MockNode; import org.elasticsearch.node.Node; import org.elasticsearch.node.NodeValidationException; import org.elasticsearch.test.SecurityIntegTestCase; -import org.elasticsearch.test.discovery.MockZenPing; +import org.elasticsearch.test.discovery.TestZenDiscovery; import org.elasticsearch.transport.Transport; import org.elasticsearch.xpack.XPackPlugin; import org.elasticsearch.xpack.security.Security; @@ -23,12 +29,6 @@ import org.elasticsearch.xpack.security.authc.file.FileRealm; import org.elasticsearch.xpack.ssl.SSLClientAuth; import org.junit.BeforeClass; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; - import static java.util.Collections.singletonMap; import static org.elasticsearch.test.SecuritySettingsSource.getSSLSettingsForStore; import static org.elasticsearch.xpack.security.test.SecurityTestUtils.writeFile; @@ -100,7 +100,7 @@ public class ServerTransportFilterIntegrationTests extends SecurityIntegTestCase .put(NetworkModule.HTTP_ENABLED.getKey(), false) .put(Node.NODE_MASTER_SETTING.getKey(), false) .build(); - try (Node node = new MockNode(nodeSettings, Arrays.asList(XPackPlugin.class, MockZenPing.TestPlugin.class))) { + try (Node node = new MockNode(nodeSettings, Arrays.asList(XPackPlugin.class, TestZenDiscovery.TestPlugin.class))) { node.start(); assertGreenClusterState(node.client()); } diff --git a/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/test/integration/NoMasterNodeTests.java b/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/test/integration/NoMasterNodeTests.java index da9f40357e2..7fd3a3905e4 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/test/integration/NoMasterNodeTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/xpack/watcher/test/integration/NoMasterNodeTests.java @@ -15,6 +15,7 @@ import org.elasticsearch.discovery.DiscoverySettings; import org.elasticsearch.discovery.MasterNotDiscoveredException; import org.elasticsearch.discovery.zen.ElectMasterService; import org.elasticsearch.discovery.zen.UnicastZenPing; +import org.elasticsearch.discovery.zen.ZenDiscovery; import org.elasticsearch.discovery.zen.ZenPing; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.discovery.ClusterDiscoveryConfiguration; @@ -226,7 +227,7 @@ public class NoMasterNodeTests extends AbstractWatcherIntegrationTestCase { // will elect itself as master. This is bad and should be fixed in core. What I think that should happen is that // if a node detects that is has lost a node, a node should clear its unicast temporal responses or at least // remove the node that has been removed. This is a workaround: - ZenPing zenPing = internalCluster().getInstance(ZenPing.class); + ZenPing zenPing = internalCluster().getInstance(ZenDiscovery.class).getZenPing(); if (zenPing instanceof UnicastZenPing) { ((UnicastZenPing) zenPing).clearTemporalResponses(); }