use of software.amazon.awssdk.services.s3.presigner.model.PresignedCreateMultipartUploadRequest in project aws-sdk-java-v2 by aws.
the class S3PresignerIntegrationTest method createMultipartUpload_CanBePresigned.
@Test
public void createMultipartUpload_CanBePresigned() throws IOException {
String objectKey = generateRandomObjectKey();
PresignedCreateMultipartUploadRequest presigned = presigner.presignCreateMultipartUpload(p -> p.signatureDuration(Duration.ofMinutes(10)).createMultipartUploadRequest(createMultipartUploadRequest(objectKey)));
HttpExecuteResponse response = execute(presigned, null);
assertThat(response.httpResponse().isSuccessful()).isTrue();
Optional<MultipartUpload> upload = getMultipartUpload(objectKey);
assertThat(upload).isPresent();
client.abortMultipartUpload(abortMultipartUploadRequest(objectKey, upload.get().uploadId()));
}
Aggregations