2929import java .util .concurrent .atomic .AtomicInteger ;
3030import java .util .concurrent .atomic .AtomicReference ;
3131
32+ import static org .hamcrest .CoreMatchers .containsString ;
33+
3234public abstract class HttpClientTimeoutTest extends HttpTestBase {
3335
3436 @ Test
@@ -266,6 +268,7 @@ public void testResponseDataTimeout() throws Exception {
266268 resp .exceptionHandler (t -> {
267269 if (count .getAndIncrement () == 0 ) {
268270 assertTrue (t instanceof TimeoutException );
271+ assertThat (t .getMessage (), containsString (testAddress .toString ()));
269272 assertEquals (expected , received );
270273 complete ();
271274 }
@@ -286,6 +289,7 @@ public void testResponseDataTimeout() throws Exception {
286289 req .exceptionHandler (t -> {
287290 if (count .getAndIncrement () == 0 ) {
288291 assertTrue (t instanceof TimeoutException );
292+ assertThat (t .getMessage (), containsString (testAddress .toString ()));
289293 assertEquals (expected , received );
290294 complete ();
291295 }
@@ -363,7 +367,10 @@ public void testRequestsTimeoutInQueue() throws Exception {
363367 for (int i = 0 ; i < 5 ; i ++) {
364368 client .request (new RequestOptions (requestOptions ).setIdleTimeout (500 ))
365369 .compose (HttpClientRequest ::send )
366- .onComplete (onFailure (t -> assertTrue (t instanceof TimeoutException )));
370+ .onComplete (onFailure (t -> {
371+ assertTrue (t instanceof TimeoutException );
372+ assertThat (t .getMessage (), containsString (testAddress .toString ()));
373+ }));
367374 }
368375 // Now another request that should not timeout
369376 client .request (new RequestOptions (requestOptions ).setIdleTimeout (3000 ))
0 commit comments