Skip to content

Commit

Permalink
test(binding/java): remove contentType header when presign write
Browse files Browse the repository at this point in the history
  • Loading branch information
G-XD committed Oct 31, 2023
1 parent 9dc9f76 commit 49bb47d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions bindings/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>${httpclient.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit 49bb47d

Please sign in to comment.