HTTPCLIENT-1958: PoolingHttpClientConnectionManager to throw ExecutionException in case of a lease operation cancellation instead of InterruptedException

This commit is contained in:
Oleg Kalnichevski 2019-01-08 12:04:17 +01:00
parent 8c4cad0057
commit 50e7dd51e0
1 changed files with 2 additions and 1 deletions

View File

@ -30,6 +30,7 @@ package org.apache.hc.client5.http.impl.io;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
@ -157,7 +158,7 @@ public class TestPoolingHttpClientConnectionManager {
Mockito.verify(pool).release(entry, false);
}
@Test(expected=InterruptedException.class)
@Test(expected= ExecutionException.class)
public void testLeaseFutureCancelled() throws Exception {
final HttpHost target = new HttpHost("localhost", 80);
final HttpRoute route = new HttpRoute(target);