Skip to content

Commit 8890917

Browse files
committed
Add test for large file upload over HTTPS
1 parent d733a5e commit 8890917

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private static String getTargetUrl() {
5858
}
5959

6060
@Test
61-
public void postBodyOverHttps() throws Throwable {
61+
public void postFileOverHttps() throws Throwable {
6262
logger.debug(">>> postBodyOverHttps");
6363
withClient(config().setSslEngineFactory(createSslEngineFactory())).run(client -> {
6464
withServer(server).run(server -> {
@@ -72,6 +72,22 @@ public void postBodyOverHttps() throws Throwable {
7272
});
7373
logger.debug("<<< postBodyOverHttps");
7474
}
75+
76+
@Test
77+
public void postLargeFileOverHttps() throws Throwable {
78+
logger.debug(">>> postLargeFileOverHttps");
79+
withClient(config().setSslEngineFactory(createSslEngineFactory())).run(client -> {
80+
withServer(server).run(server -> {
81+
server.enqueueEcho();
82+
83+
Response resp = client.preparePost(getTargetUrl()).setBody(LARGE_IMAGE_FILE).setHeader(CONTENT_TYPE, "image/png").execute().get();
84+
assertNotNull(resp);
85+
assertEquals(resp.getStatusCode(), HttpServletResponse.SC_OK);
86+
assertEquals(resp.getResponseBodyAsBytes().length, LARGE_IMAGE_FILE.length());
87+
});
88+
});
89+
logger.debug("<<< postLargeFileOverHttps");
90+
}
7591

7692
@Test
7793
public void multipleSequentialPostRequestsOverHttps() throws Throwable {

0 commit comments

Comments
 (0)