From 50e7dd51e06b877c9378846e980b99cbef2eafbb Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Tue, 8 Jan 2019 12:04:17 +0100 Subject: [PATCH] HTTPCLIENT-1958: PoolingHttpClientConnectionManager to throw ExecutionException in case of a lease operation cancellation instead of InterruptedException --- .../http/impl/io/TestPoolingHttpClientConnectionManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java index e322cff9d..580dfe193 100644 --- a/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java +++ b/httpclient5/src/test/java/org/apache/hc/client5/http/impl/io/TestPoolingHttpClientConnectionManager.java @@ -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);