Skip to content

Commit 9c6cc75

Browse files
committed
Fix compilation in security Netty 4 server tests
This commit fixes compilation in SimpleSecurityNetty4ServerTransportTests after a backport missed updating this class.
1 parent 4e3d7ee commit 9c6cc75

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

test/framework/src/main/java/org/elasticsearch/transport/AbstractSimpleTransportTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public abstract class AbstractSimpleTransportTestCase extends ESTestCase {
114114
protected volatile DiscoveryNode nodeB;
115115
protected volatile MockTransportService serviceB;
116116

117-
private MockTransportService build(Settings settings, Version version, ClusterSettings clusterSettings, boolean doHandshake) {
117+
protected final MockTransportService build(Settings settings, Version version, ClusterSettings clusterSettings, boolean doHandshake) {
118118
return build(settings, version, clusterSettings, doHandshake, NOOP_TRANSPORT_INTERCEPTOR);
119119
}
120120

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/transport/netty4/SimpleSecurityNetty4ServerTransportTests.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.elasticsearch.transport.ConnectionProfile;
2929
import org.elasticsearch.transport.TcpChannel;
3030
import org.elasticsearch.transport.Transport;
31+
import org.elasticsearch.transport.TransportInterceptor;
3132
import org.elasticsearch.transport.TransportRequestOptions;
3233
import org.elasticsearch.transport.TransportSettings;
3334
import org.elasticsearch.xpack.core.ssl.SSLService;
@@ -64,7 +65,7 @@ public class SimpleSecurityNetty4ServerTransportTests extends AbstractSimpleSecu
6465
}
6566

6667
public MockTransportService nettyFromThreadPool(Settings settings, ThreadPool threadPool, final Version version,
67-
ClusterSettings clusterSettings, boolean doHandshake) {
68+
ClusterSettings clusterSettings, boolean doHandshake, TransportInterceptor interceptor) {
6869
NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry(Collections.emptyList());
6970
NetworkService networkService = new NetworkService(Collections.emptyList());
7071
Settings settings1 = Settings.builder()
@@ -86,19 +87,25 @@ public void executeHandshake(DiscoveryNode node, TcpChannel channel, ConnectionP
8687
};
8788
MockTransportService mockTransportService =
8889
MockTransportService.createNewService(settings, transport, version, threadPool, clusterSettings,
89-
Collections.emptySet());
90+
Collections.emptySet(), interceptor);
9091
mockTransportService.start();
9192
return mockTransportService;
9293
}
9394

9495
@Override
95-
protected MockTransportService build(Settings settings, Version version, ClusterSettings clusterSettings, boolean doHandshake) {
96+
protected MockTransportService build(
97+
Settings settings,
98+
Version version,
99+
ClusterSettings clusterSettings,
100+
boolean doHandshake,
101+
TransportInterceptor interceptor) {
96102
if (TransportSettings.PORT.exists(settings) == false) {
97103
settings = Settings.builder().put(settings)
98104
.put(TransportSettings.PORT.getKey(), "0")
99105
.build();
100106
}
101-
MockTransportService transportService = nettyFromThreadPool(settings, threadPool, version, clusterSettings, doHandshake);
107+
MockTransportService transportService =
108+
nettyFromThreadPool(settings, threadPool, version, clusterSettings, doHandshake, interceptor);
102109
transportService.start();
103110
return transportService;
104111
}

0 commit comments

Comments
 (0)