This is an automated email from the ASF dual-hosted git repository.

gxd pushed a commit to branch fix_binding_java
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/fix_binding_java by this push:
     new 49bb47d45 test(binding/java): remove contentType header when presign 
write
49bb47d45 is described below

commit 49bb47d453a0a903fe8d223fe89e4dbb8c773e7b
Author: G-XD <[email protected]>
AuthorDate: Wed Nov 1 00:18:01 2023 +0800

    test(binding/java): remove contentType header when presign write
---
 bindings/java/pom.xml                                               | 1 +
 .../java/org/apache/opendal/test/behavior/AsyncPresignTest.java     | 6 ++----
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/bindings/java/pom.xml b/bindings/java/pom.xml
index 6536ec442..5780f735d 100644
--- a/bindings/java/pom.xml
+++ b/bindings/java/pom.xml
@@ -106,6 +106,7 @@
                 <groupId>org.apache.httpcomponents.client5</groupId>
                 <artifactId>httpclient5</artifactId>
                 <version>${httpclient.version}</version>
+                <scope>test</scope>
             </dependency>
         </dependencies>
     </dependencyManagement>
diff --git 
a/bindings/java/src/test/java/org/apache/opendal/test/behavior/AsyncPresignTest.java
 
b/bindings/java/src/test/java/org/apache/opendal/test/behavior/AsyncPresignTest.java
index 4f2a33c59..52bf27dc6 100644
--- 
a/bindings/java/src/test/java/org/apache/opendal/test/behavior/AsyncPresignTest.java
+++ 
b/bindings/java/src/test/java/org/apache/opendal/test/behavior/AsyncPresignTest.java
@@ -28,11 +28,9 @@ import java.security.NoSuchAlgorithmException;
 import java.time.Duration;
 import java.util.Map;
 import java.util.UUID;
-import org.apache.hc.client5.http.entity.EntityBuilder;
 import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
 import org.apache.hc.client5.http.impl.classic.HttpClients;
 import org.apache.hc.core5.http.ClassicHttpResponse;
-import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpHeaders;
 import org.apache.hc.core5.http.HttpStatus;
 import org.apache.hc.core5.http.io.entity.EntityUtils;
@@ -65,15 +63,15 @@ public class AsyncPresignTest extends BehaviorTestBase {
                 op().presignWrite(path, Duration.ofSeconds(3600)).join();
 
         try (CloseableHttpClient httpclient = HttpClients.createDefault()) {
-            final HttpEntity body = 
EntityBuilder.create().setBinary(content).build();
             final ClassicRequestBuilder builder =
-                    createRequestBuilder(signedReq).setEntity(body);
+                    createRequestBuilder(signedReq).setEntity(content, null);
 
             httpclient.execute(builder.build(), rsp -> rsp);
         }
 
         final Metadata meta = op().stat(path).join();
         assertEquals(content.length, meta.getContentLength());
+
         op().delete(path).join();
     }
 

Reply via email to