use of software.amazon.awssdk.services.s3.presigner.model.PresignedAbortMultipartUploadRequest in project aws-sdk-java-v2 by aws.
the class S3PresignerIntegrationTest method abortMultipartUpload_CanBePresigned.
@Test
public void abortMultipartUpload_CanBePresigned() throws IOException {
String objectKey = generateRandomObjectKey();
S3TestUtils.addCleanupTask(S3PresignerIntegrationTest.class, () -> client.deleteObject(r -> r.bucket(testBucket).key(objectKey)));
CreateMultipartUploadResponse create = client.createMultipartUpload(createMultipartUploadRequest(objectKey));
S3TestUtils.addCleanupTask(S3PresignerIntegrationTest.class, () -> client.abortMultipartUpload(abortMultipartUploadRequest(objectKey, create.uploadId())));
PresignedAbortMultipartUploadRequest presignedRequest = presigner.presignAbortMultipartUpload(r -> r.signatureDuration(Duration.ofDays(1)).abortMultipartUploadRequest(abortMultipartUploadRequest(objectKey, create.uploadId())));
assertThat(execute(presignedRequest, null).httpResponse().isSuccessful()).isTrue();
assertThat(getMultipartUpload(objectKey)).isNotPresent();
}
Aggregations