diff --git a/elasticsearch/src/test/java/org/elasticsearch/transport/KnownActionsTests.java b/elasticsearch/src/test/java/org/elasticsearch/transport/KnownActionsTests.java index 109e1cd4e3a..252263505d4 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/transport/KnownActionsTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/transport/KnownActionsTests.java @@ -10,6 +10,7 @@ import org.elasticsearch.action.Action; import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.io.Streams; import org.elasticsearch.license.Licensing; +import org.elasticsearch.plugins.Plugin; import org.elasticsearch.xpack.security.action.SecurityActionModule; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; import org.elasticsearch.test.SecurityIntegTestCase; @@ -36,6 +37,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.stream.Collectors; import static java.util.Collections.unmodifiableSet; import static org.hamcrest.CoreMatchers.hasItems; @@ -48,6 +50,13 @@ public class KnownActionsTests extends SecurityIntegTestCase { private static Set knownHandlers; private static Set codeActions; + @Override + protected Collection> getMockPlugins() { + Collection> mockPlugins = super.getMockPlugins(); + // no handler wrapping here we check the requestHandlers below and this plugin wraps it + return mockPlugins.stream().filter(p -> p != AssertingTransportInterceptor.TestPlugin.class).collect(Collectors.toList()); + } + @BeforeClass public static void init() throws Exception { knownActions = loadKnownActions(); diff --git a/elasticsearch/src/test/java/org/elasticsearch/transport/SecurityServerTransportServiceTests.java b/elasticsearch/src/test/java/org/elasticsearch/transport/SecurityServerTransportServiceTests.java index 0dbfa545b96..27616a91c03 100644 --- a/elasticsearch/src/test/java/org/elasticsearch/transport/SecurityServerTransportServiceTests.java +++ b/elasticsearch/src/test/java/org/elasticsearch/transport/SecurityServerTransportServiceTests.java @@ -5,9 +5,12 @@ */ package org.elasticsearch.transport; +import java.util.Collection; import java.util.Map; +import java.util.stream.Collectors; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.SecurityIntegTestCase; import org.elasticsearch.xpack.XPackSettings; import org.elasticsearch.xpack.security.transport.SecurityServerTransportInterceptor; @@ -25,6 +28,13 @@ public class SecurityServerTransportServiceTests extends SecurityIntegTestCase { .build(); } + @Override + protected Collection> getMockPlugins() { + Collection> mockPlugins = super.getMockPlugins(); + // no handler wrapping here we check the requestHandlers below and this plugin wraps it + return mockPlugins.stream().filter(p -> p != AssertingTransportInterceptor.TestPlugin.class).collect(Collectors.toList()); + } + public void testSecurityServerTransportServiceWrapsAllHandlers() { for (TransportService transportService : internalCluster().getInstances(TransportService.class)) { for (Map.Entry entry : transportService.requestHandlers.entrySet()) {