|
@@ -6,6 +6,7 @@
|
|
|
package org.elasticsearch.xpack.security.transport.nio;
|
|
|
|
|
|
import org.elasticsearch.common.network.NetworkService;
|
|
|
+import org.elasticsearch.common.settings.ClusterSettings;
|
|
|
import org.elasticsearch.common.settings.MockSecureSettings;
|
|
|
import org.elasticsearch.common.settings.Settings;
|
|
|
import org.elasticsearch.common.util.BigArrays;
|
|
@@ -74,7 +75,8 @@ public class SecurityNioHttpServerTransportTests extends ESTestCase {
|
|
|
sslService = new SSLService(TestEnvironment.newEnvironment(settings));
|
|
|
SecurityNioHttpServerTransport transport = new SecurityNioHttpServerTransport(settings,
|
|
|
new NetworkService(Collections.emptyList()), mock(BigArrays.class), mock(PageCacheRecycler.class), mock(ThreadPool.class),
|
|
|
- xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory);
|
|
|
+ xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory,
|
|
|
+ new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS));
|
|
|
SecurityNioHttpServerTransport.SecurityHttpChannelFactory factory = transport.channelFactory();
|
|
|
SocketChannel socketChannel = mock(SocketChannel.class);
|
|
|
when(socketChannel.getRemoteAddress()).thenReturn(address);
|
|
@@ -95,7 +97,8 @@ public class SecurityNioHttpServerTransportTests extends ESTestCase {
|
|
|
nioGroupFactory = new NioGroupFactory(settings, logger);
|
|
|
SecurityNioHttpServerTransport transport = new SecurityNioHttpServerTransport(settings,
|
|
|
new NetworkService(Collections.emptyList()), mock(BigArrays.class), mock(PageCacheRecycler.class), mock(ThreadPool.class),
|
|
|
- xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory);
|
|
|
+ xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory,
|
|
|
+ new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS));
|
|
|
|
|
|
SecurityNioHttpServerTransport.SecurityHttpChannelFactory factory = transport.channelFactory();
|
|
|
SocketChannel socketChannel = mock(SocketChannel.class);
|
|
@@ -116,7 +119,8 @@ public class SecurityNioHttpServerTransportTests extends ESTestCase {
|
|
|
sslService = new SSLService(TestEnvironment.newEnvironment(settings));
|
|
|
SecurityNioHttpServerTransport transport = new SecurityNioHttpServerTransport(settings,
|
|
|
new NetworkService(Collections.emptyList()), mock(BigArrays.class), mock(PageCacheRecycler.class), mock(ThreadPool.class),
|
|
|
- xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory);
|
|
|
+ xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory,
|
|
|
+ new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS));
|
|
|
|
|
|
SecurityNioHttpServerTransport.SecurityHttpChannelFactory factory = transport.channelFactory();
|
|
|
SocketChannel socketChannel = mock(SocketChannel.class);
|
|
@@ -137,7 +141,8 @@ public class SecurityNioHttpServerTransportTests extends ESTestCase {
|
|
|
nioGroupFactory = new NioGroupFactory(settings, logger);
|
|
|
SecurityNioHttpServerTransport transport = new SecurityNioHttpServerTransport(settings,
|
|
|
new NetworkService(Collections.emptyList()), mock(BigArrays.class), mock(PageCacheRecycler.class), mock(ThreadPool.class),
|
|
|
- xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory);
|
|
|
+ xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory,
|
|
|
+ new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS));
|
|
|
|
|
|
SecurityNioHttpServerTransport.SecurityHttpChannelFactory factory = transport.channelFactory();
|
|
|
SocketChannel socketChannel = mock(SocketChannel.class);
|
|
@@ -156,7 +161,8 @@ public class SecurityNioHttpServerTransportTests extends ESTestCase {
|
|
|
nioGroupFactory = new NioGroupFactory(settings, logger);
|
|
|
SecurityNioHttpServerTransport transport = new SecurityNioHttpServerTransport(settings,
|
|
|
new NetworkService(Collections.emptyList()), mock(BigArrays.class), mock(PageCacheRecycler.class), mock(ThreadPool.class),
|
|
|
- xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory);
|
|
|
+ xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory,
|
|
|
+ new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS));
|
|
|
SecurityNioHttpServerTransport.SecurityHttpChannelFactory factory = transport.channelFactory();
|
|
|
SocketChannel socketChannel = mock(SocketChannel.class);
|
|
|
when(socketChannel.getRemoteAddress()).thenReturn(address);
|
|
@@ -172,7 +178,8 @@ public class SecurityNioHttpServerTransportTests extends ESTestCase {
|
|
|
nioGroupFactory = new NioGroupFactory(settings, logger);
|
|
|
transport = new SecurityNioHttpServerTransport(settings,
|
|
|
new NetworkService(Collections.emptyList()), mock(BigArrays.class), mock(PageCacheRecycler.class), mock(ThreadPool.class),
|
|
|
- xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory);
|
|
|
+ xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory,
|
|
|
+ new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS));
|
|
|
factory = transport.channelFactory();
|
|
|
channel = factory.createChannel(mock(NioSelector.class), socketChannel, mock(Config.Socket.class));
|
|
|
SSLEngine customEngine = SSLEngineUtils.getSSLEngine(channel);
|
|
@@ -195,6 +202,7 @@ public class SecurityNioHttpServerTransportTests extends ESTestCase {
|
|
|
nioGroupFactory = new NioGroupFactory(settings, logger);
|
|
|
SecurityNioHttpServerTransport transport = new SecurityNioHttpServerTransport(settings,
|
|
|
new NetworkService(Collections.emptyList()), mock(BigArrays.class), mock(PageCacheRecycler.class), mock(ThreadPool.class),
|
|
|
- xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory);
|
|
|
+ xContentRegistry(), new NullDispatcher(), mock(IPFilter.class), sslService, nioGroupFactory,
|
|
|
+ new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS));
|
|
|
}
|
|
|
}
|