15
15
import static org .asynchttpclient .Dsl .*;
16
16
import static org .asynchttpclient .test .TestUtils .*;
17
17
import static org .testng .Assert .assertEquals ;
18
- import io .netty .handler .codec .http .HttpHeaders ;
19
-
20
- import java .io .IOException ;
21
- import java .util .concurrent .ExecutionException ;
22
- import java .util .concurrent .TimeoutException ;
23
18
24
19
import org .asynchttpclient .AbstractBasicTest ;
25
20
import org .asynchttpclient .AsyncHttpClient ;
@@ -68,18 +63,17 @@ public void tearDownGlobal() throws Exception {
68
63
}
69
64
70
65
@ Test (groups = "standalone" )
71
- public void testRequestProxy () throws IOException , InterruptedException , ExecutionException , TimeoutException {
66
+ public void testRequestProxy () throws Exception {
72
67
73
68
try (AsyncHttpClient asyncHttpClient = asyncHttpClient (config ().setFollowRedirect (true ).setAcceptAnyCertificate (true ))) {
74
69
RequestBuilder rb = get (getTargetUrl2 ()).setProxyServer (proxyServer ("127.0.0.1" , port1 ));
75
70
Response r = asyncHttpClient .executeRequest (rb .build ()).get ();
76
71
assertEquals (r .getStatusCode (), 200 );
77
- assertEquals (r .getHeader ("X-Connection" ), HttpHeaders .Values .KEEP_ALIVE );
78
72
}
79
73
}
80
74
81
75
@ Test (groups = "standalone" )
82
- public void testConfigProxy () throws IOException , InterruptedException , ExecutionException , TimeoutException {
76
+ public void testConfigProxy () throws Exception {
83
77
AsyncHttpClientConfig config = config ()//
84
78
.setFollowRedirect (true )//
85
79
.setProxyServer (proxyServer ("127.0.0.1" , port1 ).build ())//
@@ -88,12 +82,11 @@ public void testConfigProxy() throws IOException, InterruptedException, Executio
88
82
try (AsyncHttpClient asyncHttpClient = asyncHttpClient (config )) {
89
83
Response r = asyncHttpClient .executeRequest (get (getTargetUrl2 ())).get ();
90
84
assertEquals (r .getStatusCode (), 200 );
91
- assertEquals (r .getHeader ("X-Connection" ), HttpHeaders .Values .KEEP_ALIVE );
92
85
}
93
86
}
94
87
95
88
@ Test (groups = "standalone" )
96
- public void testPooledConnectionsWithProxy () throws IOException , InterruptedException , ExecutionException , TimeoutException {
89
+ public void testPooledConnectionsWithProxy () throws Exception {
97
90
98
91
try (AsyncHttpClient asyncHttpClient = asyncHttpClient (config ().setFollowRedirect (true ).setAcceptAnyCertificate (true ).setKeepAlive (true ))) {
99
92
RequestBuilder rb = get (getTargetUrl2 ()).setProxyServer (proxyServer ("127.0.0.1" , port1 ));
0 commit comments