This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 3c51db285b43fbac9d712b891dbe2bbad6365955 Author: Benoit Tellier <[email protected]> AuthorDate: Mon Aug 26 15:04:36 2019 +0700 JAMES-2178 Reindent Upload requests in JMAP integration tests --- .../jmap/methods/integration/cucumber/UploadStepdefs.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java index 757bd26..e1a1ab1 100644 --- a/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java +++ b/server/protocols/jmap-integration-testing/jmap-integration-testing-common/src/test/java/org/apache/james/jmap/methods/integration/cucumber/UploadStepdefs.java @@ -38,6 +38,7 @@ import org.apache.http.client.fluent.Content; import org.apache.http.client.fluent.Executor; import org.apache.http.client.fluent.Request; import org.apache.http.concurrent.FutureCallback; +import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClientBuilder; import org.apache.james.jmap.api.access.AccessToken; import org.apache.james.util.CountDownConsumeInputStream; @@ -109,14 +110,24 @@ public class UploadStepdefs { .bodyStream(new BufferedInputStream(new ZeroedInputStream(_1M), _1M), org.apache.http.entity.ContentType.DEFAULT_BINARY); request.addHeader("Authorization", accessToken.serialize()); - response = Executor.newInstance(HttpClientBuilder.create().disableAutomaticRetries().build()).execute(request).returnResponse(); + response = Executor.newInstance(newClient()) + .execute(request) + .returnResponse(); } @When("^someone upload a content without authentification$") public void userUploadContentWithoutAuthentification() throws Throwable { Request request = Request.Post(uploadUri) .bodyStream(new BufferedInputStream(new ZeroedInputStream(_1M), _1M), org.apache.http.entity.ContentType.DEFAULT_BINARY); - response = Executor.newInstance(HttpClientBuilder.create().disableAutomaticRetries().build()).execute(request).returnResponse(); + response = Executor.newInstance(newClient()) + .execute(request) + .returnResponse(); + } + + private CloseableHttpClient newClient() { + return HttpClientBuilder.create() + .disableAutomaticRetries() + .build(); } @When("^\"([^\"]*)\" upload a content without content type$") --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
