28
28
import org .elasticsearch .transport .ConnectionProfile ;
29
29
import org .elasticsearch .transport .TcpChannel ;
30
30
import org .elasticsearch .transport .Transport ;
31
+ import org .elasticsearch .transport .TransportInterceptor ;
31
32
import org .elasticsearch .transport .TransportRequestOptions ;
32
33
import org .elasticsearch .transport .TransportSettings ;
33
34
import org .elasticsearch .xpack .core .ssl .SSLService ;
@@ -64,7 +65,7 @@ public class SimpleSecurityNetty4ServerTransportTests extends AbstractSimpleSecu
64
65
}
65
66
66
67
public MockTransportService nettyFromThreadPool (Settings settings , ThreadPool threadPool , final Version version ,
67
- ClusterSettings clusterSettings , boolean doHandshake ) {
68
+ ClusterSettings clusterSettings , boolean doHandshake , TransportInterceptor interceptor ) {
68
69
NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry (Collections .emptyList ());
69
70
NetworkService networkService = new NetworkService (Collections .emptyList ());
70
71
Settings settings1 = Settings .builder ()
@@ -86,19 +87,25 @@ public void executeHandshake(DiscoveryNode node, TcpChannel channel, ConnectionP
86
87
};
87
88
MockTransportService mockTransportService =
88
89
MockTransportService .createNewService (settings , transport , version , threadPool , clusterSettings ,
89
- Collections .emptySet ());
90
+ Collections .emptySet (), interceptor );
90
91
mockTransportService .start ();
91
92
return mockTransportService ;
92
93
}
93
94
94
95
@ 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 ) {
96
102
if (TransportSettings .PORT .exists (settings ) == false ) {
97
103
settings = Settings .builder ().put (settings )
98
104
.put (TransportSettings .PORT .getKey (), "0" )
99
105
.build ();
100
106
}
101
- MockTransportService transportService = nettyFromThreadPool (settings , threadPool , version , clusterSettings , doHandshake );
107
+ MockTransportService transportService =
108
+ nettyFromThreadPool (settings , threadPool , version , clusterSettings , doHandshake , interceptor );
102
109
transportService .start ();
103
110
return transportService ;
104
111
}
0 commit comments