@@ -99,7 +99,7 @@ void testConnect() throws Exception {
99
99
Mockito .when (dnsResolver .resolve ("somehost" , port )).thenReturn (resolvedAddresses );
100
100
101
101
Mockito .when (schemePortResolver .resolve (host .getSchemeName (), host )).thenReturn (port );
102
- Mockito .when (detachedSocketFactory .create (Mockito .any ())).thenReturn (socket );
102
+ Mockito .when (detachedSocketFactory .create (Mockito .any (), Mockito . any () )).thenReturn (socket );
103
103
104
104
final SocketConfig socketConfig = SocketConfig .custom ()
105
105
.setSoKeepAlive (true )
@@ -143,7 +143,7 @@ void testConnectWithTLSUpgrade() throws Exception {
143
143
Mockito .when (dnsResolver .resolve ("somehost" , port )).thenReturn (resolvedAddresses );
144
144
145
145
Mockito .when (schemePortResolver .resolve (host .getSchemeName (), host )).thenReturn (port );
146
- Mockito .when (detachedSocketFactory .create (Mockito .any ())).thenReturn (socket );
146
+ Mockito .when (detachedSocketFactory .create (Mockito .any (), Mockito . any () )).thenReturn (socket );
147
147
148
148
Mockito .when (tlsSocketStrategyLookup .lookup ("https" )).thenReturn (tlsSocketStrategy );
149
149
final SSLSocket upgradedSocket = Mockito .mock (SSLSocket .class );
@@ -178,7 +178,7 @@ void testConnectTimeout() throws Exception {
178
178
);
179
179
Mockito .when (dnsResolver .resolve ("somehost" , port )).thenReturn (resolvedAddresses );
180
180
Mockito .when (schemePortResolver .resolve (host .getSchemeName (), host )).thenReturn (port );
181
- Mockito .when (detachedSocketFactory .create (Mockito .any ())).thenReturn (socket );
181
+ Mockito .when (detachedSocketFactory .create (Mockito .any (), Mockito . any () )).thenReturn (socket );
182
182
Mockito .doThrow (new SocketTimeoutException ()).when (socket ).connect (Mockito .any (), Mockito .anyInt ());
183
183
Assertions .assertThrows (ConnectTimeoutException .class , () ->
184
184
connectionOperator .connect (
@@ -200,7 +200,7 @@ void testConnectFailure() throws Exception {
200
200
Mockito .when (dnsResolver .resolve ("somehost" , port )).thenReturn (resolvedAddresses );
201
201
202
202
Mockito .when (schemePortResolver .resolve (host .getSchemeName (), host )).thenReturn (port );
203
- Mockito .when (detachedSocketFactory .create (Mockito .any ())).thenReturn (socket );
203
+ Mockito .when (detachedSocketFactory .create (Mockito .any (), Mockito . any () )).thenReturn (socket );
204
204
Mockito .doThrow (new ConnectException ()).when (socket ).connect (Mockito .any (), Mockito .anyInt ());
205
205
206
206
Assertions .assertThrows (HttpHostConnectException .class , () ->
@@ -218,7 +218,7 @@ void testConnectFailover() throws Exception {
218
218
219
219
Mockito .when (dnsResolver .resolve ("somehost" , 80 )).thenReturn (Arrays .asList (ipAddress1 , ipAddress2 ));
220
220
Mockito .when (schemePortResolver .resolve (host .getSchemeName (), host )).thenReturn (80 );
221
- Mockito .when (detachedSocketFactory .create (Mockito .any ())).thenReturn (socket );
221
+ Mockito .when (detachedSocketFactory .create (Mockito .any (), Mockito . any () )).thenReturn (socket );
222
222
Mockito .doThrow (new ConnectException ()).when (socket ).connect (
223
223
Mockito .eq (ipAddress1 ),
224
224
Mockito .anyInt ());
@@ -243,7 +243,7 @@ void testConnectExplicitAddress() throws Exception {
243
243
final HttpHost host = new HttpHost (ip );
244
244
245
245
Mockito .when (schemePortResolver .resolve (host .getSchemeName (), host )).thenReturn (80 );
246
- Mockito .when (detachedSocketFactory .create (Mockito .any ())).thenReturn (socket );
246
+ Mockito .when (detachedSocketFactory .create (Mockito .any (), Mockito . any () )).thenReturn (socket );
247
247
248
248
final InetSocketAddress localAddress = new InetSocketAddress (local , 0 );
249
249
final TlsConfig tlsConfig = TlsConfig .custom ()
@@ -316,7 +316,7 @@ void testConnectWithDisableDnsResolution() throws Exception {
316
316
Mockito .when (dnsResolver .resolve (host .getHostName (), port )).thenReturn (resolvedAddresses );
317
317
318
318
Mockito .when (schemePortResolver .resolve (host .getSchemeName (), host )).thenReturn (port );
319
- Mockito .when (detachedSocketFactory .create (Mockito .any ())).thenReturn (socket );
319
+ Mockito .when (detachedSocketFactory .create (Mockito .any (), Mockito . any () )).thenReturn (socket );
320
320
321
321
final SocketConfig socketConfig = SocketConfig .custom ()
322
322
.setSoKeepAlive (true )
@@ -359,7 +359,7 @@ void testConnectWithDnsResolutionAndFallback() throws Exception {
359
359
);
360
360
Mockito .when (dnsResolver .resolve ("fallbackhost.com" , port )).thenReturn (resolvedAddresses );
361
361
Mockito .when (schemePortResolver .resolve (host .getSchemeName (), host )).thenReturn (port );
362
- Mockito .when (detachedSocketFactory .create (Mockito .any ())).thenReturn (socket );
362
+ Mockito .when (detachedSocketFactory .create (Mockito .any (), Mockito . any () )).thenReturn (socket );
363
363
364
364
// Simulate failure to connect to the first resolved address
365
365
Mockito .doThrow (new ConnectException ()).when (socket ).connect (Mockito .eq (new InetSocketAddress (ip1 , port )), Mockito .anyInt ());
0 commit comments