Skip to content

Commit 240b7d2

Browse files
committed
Fix tests
1 parent 21300f9 commit 240b7d2

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

client/src/test/java/org/asynchttpclient/BasicHttpTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ public void onThrowable(Throwable t) {
664664
}).get();
665665

666666
assertEquals(response.getStatusCode(), 200);
667-
assertEquals(response.getHeader("X-Connection"), "keep-alive");
667+
assertEquals(response.getHeader("X-" + HttpHeaders.Names.CONTENT_TYPE), HttpHeaders.Values.APPLICATION_X_WWW_FORM_URLENCODED);
668668
}
669669
}
670670

client/src/test/java/org/asynchttpclient/proxy/HttpsProxyTest.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515
import static org.asynchttpclient.Dsl.*;
1616
import static org.asynchttpclient.test.TestUtils.*;
1717
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;
2318

2419
import org.asynchttpclient.AbstractBasicTest;
2520
import org.asynchttpclient.AsyncHttpClient;
@@ -68,18 +63,17 @@ public void tearDownGlobal() throws Exception {
6863
}
6964

7065
@Test(groups = "standalone")
71-
public void testRequestProxy() throws IOException, InterruptedException, ExecutionException, TimeoutException {
66+
public void testRequestProxy() throws Exception {
7267

7368
try (AsyncHttpClient asyncHttpClient = asyncHttpClient(config().setFollowRedirect(true).setAcceptAnyCertificate(true))) {
7469
RequestBuilder rb = get(getTargetUrl2()).setProxyServer(proxyServer("127.0.0.1", port1));
7570
Response r = asyncHttpClient.executeRequest(rb.build()).get();
7671
assertEquals(r.getStatusCode(), 200);
77-
assertEquals(r.getHeader("X-Connection"), HttpHeaders.Values.KEEP_ALIVE);
7872
}
7973
}
8074

8175
@Test(groups = "standalone")
82-
public void testConfigProxy() throws IOException, InterruptedException, ExecutionException, TimeoutException {
76+
public void testConfigProxy() throws Exception {
8377
AsyncHttpClientConfig config = config()//
8478
.setFollowRedirect(true)//
8579
.setProxyServer(proxyServer("127.0.0.1", port1).build())//
@@ -88,12 +82,11 @@ public void testConfigProxy() throws IOException, InterruptedException, Executio
8882
try (AsyncHttpClient asyncHttpClient = asyncHttpClient(config)) {
8983
Response r = asyncHttpClient.executeRequest(get(getTargetUrl2())).get();
9084
assertEquals(r.getStatusCode(), 200);
91-
assertEquals(r.getHeader("X-Connection"), HttpHeaders.Values.KEEP_ALIVE);
9285
}
9386
}
9487

9588
@Test(groups = "standalone")
96-
public void testPooledConnectionsWithProxy() throws IOException, InterruptedException, ExecutionException, TimeoutException {
89+
public void testPooledConnectionsWithProxy() throws Exception {
9790

9891
try (AsyncHttpClient asyncHttpClient = asyncHttpClient(config().setFollowRedirect(true).setAcceptAnyCertificate(true).setKeepAlive(true))) {
9992
RequestBuilder rb = get(getTargetUrl2()).setProxyServer(proxyServer("127.0.0.1", port1));

extras/simple/src/test/java/org/asynchttpclient/extras/simple/HttpsProxyTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import static org.asynchttpclient.test.TestUtils.*;
44
import static org.testng.Assert.assertEquals;
5-
import io.netty.handler.codec.http.HttpHeaders;
65

76
import java.io.IOException;
87
import java.util.concurrent.ExecutionException;
@@ -62,7 +61,6 @@ public void testSimpleAHCConfigProxy() throws IOException, InterruptedException,
6261
Response r = client.get().get();
6362

6463
assertEquals(r.getStatusCode(), 200);
65-
assertEquals(r.getHeader("X-Connection"), HttpHeaders.Values.KEEP_ALIVE);
6664
}
6765
}
6866
}

0 commit comments

Comments
 (0)