diff --git a/bindings/java/pom.xml b/bindings/java/pom.xml
index 6536ec442594..5780f735da87 100644
--- a/bindings/java/pom.xml
+++ b/bindings/java/pom.xml
@@ -106,6 +106,7 @@
org.apache.httpcomponents.client5
httpclient5
${httpclient.version}
+ test
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 4f2a33c59a4a..52bf27dc6c06 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.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 void testPresignWrite() throws IOException {
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();
}