File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
src/test/java/org/baeldung/httpclient
spring-security-rest-basic-auth Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -8,4 +8,5 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
88### Relevant Articles:
99
1010- [ HttpClient 4 – Get the Status Code] ( http://www.baeldung.com/httpclient-status-code )
11- - [ HttpClient with SSL] ( http://www.baeldung.com/httpclient-ssl )
11+ - [ HttpClient with SSL] ( http://www.baeldung.com/httpclient-ssl )
12+ - [ HttpClient Timeout] ( http://www.baeldung.com/httpclient-timeout )
Original file line number Diff line number Diff line change 11package org .baeldung .httpclient ;
22
3+ import static org .hamcrest .Matchers .equalTo ;
4+ import static org .junit .Assert .assertThat ;
5+
6+ import java .io .IOException ;
7+
38import org .apache .http .client .config .RequestConfig ;
49import org .apache .http .client .methods .CloseableHttpResponse ;
510import org .apache .http .client .methods .HttpGet ;
611import org .apache .http .config .SocketConfig ;
7- import org .apache .http .conn .HttpHostConnectException ;
12+ import org .apache .http .conn .ConnectTimeoutException ;
813import org .apache .http .impl .client .CloseableHttpClient ;
914import org .apache .http .impl .client .HttpClientBuilder ;
1015import org .junit .After ;
1116import org .junit .Test ;
1217
13- import java .io .IOException ;
14-
15- import static org .hamcrest .Matchers .equalTo ;
16- import static org .junit .Assert .assertThat ;
17-
1818public class HttpClientTimeoutLiveTest {
1919
2020 private CloseableHttpResponse response ;
@@ -71,7 +71,7 @@ public final void givenUsingNewApi_whenSettingTimeoutViaHighLevelApi_thenCorrect
7171 /**
7272 * This simulates a timeout against a domain with multiple routes/IPs to it (not a single raw IP)
7373 */
74- @ Test (expected = HttpHostConnectException .class )
74+ @ Test (expected = ConnectTimeoutException .class )
7575 public final void givenTimeoutIsConfigured_whenTimingOut_thenTimeoutException () throws IOException {
7676 final int timeout = 3 ;
7777
Original file line number Diff line number Diff line change @@ -7,6 +7,5 @@ The "Learn Spring Security" Classes: http://github.learnspringsecurity.com
77
88### Relevant Articles:
99- [ Basic Authentication with the RestTemplate] ( http://www.baeldung.com/how-to-use-resttemplate-with-basic-authentication-in-spring )
10- - [ HttpClient Timeout] ( http://www.baeldung.com/httpclient-timeout )
1110- [ A Custom Filter in the Spring Security Filter Chain] ( http://www.baeldung.com/spring-security-custom-filter )
1211- [ Spring Security Basic Authentication] ( http://www.baeldung.com/spring-security-basic-authentication )
You can’t perform that action at this time.
0 commit comments