Skip to content

Commit

Permalink
Add test for large file upload over HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
slandelle committed Apr 26, 2017
1 parent d733a5e commit 8890917
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion client/src/test/java/org/asynchttpclient/BasicHttpsTest.java
Expand Up @@ -58,7 +58,7 @@ private static String getTargetUrl() {
}

@Test
public void postBodyOverHttps() throws Throwable {
public void postFileOverHttps() throws Throwable {
logger.debug(">>> postBodyOverHttps");
withClient(config().setSslEngineFactory(createSslEngineFactory())).run(client -> {
withServer(server).run(server -> {
Expand All @@ -72,6 +72,22 @@ public void postBodyOverHttps() throws Throwable {
});
logger.debug("<<< postBodyOverHttps");
}

@Test
public void postLargeFileOverHttps() throws Throwable {
logger.debug(">>> postLargeFileOverHttps");
withClient(config().setSslEngineFactory(createSslEngineFactory())).run(client -> {
withServer(server).run(server -> {
server.enqueueEcho();

Response resp = client.preparePost(getTargetUrl()).setBody(LARGE_IMAGE_FILE).setHeader(CONTENT_TYPE, "image/png").execute().get();
assertNotNull(resp);
assertEquals(resp.getStatusCode(), HttpServletResponse.SC_OK);
assertEquals(resp.getResponseBodyAsBytes().length, LARGE_IMAGE_FILE.length());
});
});
logger.debug("<<< postLargeFileOverHttps");
}

@Test
public void multipleSequentialPostRequestsOverHttps() throws Throwable {
Expand Down

0 comments on commit 8890917

Please sign in to comment.