diff --git a/services-custom/s3-transfer-manager/pom.xml b/services-custom/s3-transfer-manager/pom.xml index 42ba838e9ed8..9968535f9df9 100644 --- a/services-custom/s3-transfer-manager/pom.xml +++ b/services-custom/s3-transfer-manager/pom.xml @@ -212,6 +212,11 @@ ${commons-codec.verion} test + + wiremock-jre8 + com.github.tomakehurst + test + diff --git a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerUploadIntegrationTest.java b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerUploadIntegrationTest.java index f87059596732..026652ecef62 100644 --- a/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerUploadIntegrationTest.java +++ b/services-custom/s3-transfer-manager/src/it/java/software/amazon/awssdk/transfer/s3/S3TransferManagerUploadIntegrationTest.java @@ -26,7 +26,6 @@ import java.util.Map; import java.util.UUID; import java.util.concurrent.CancellationException; -import java.util.concurrent.CompletionException; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -35,7 +34,6 @@ import software.amazon.awssdk.core.sync.ResponseTransformer; import software.amazon.awssdk.services.s3.model.ChecksumAlgorithm; import software.amazon.awssdk.services.s3.model.GetObjectResponse; -import software.amazon.awssdk.services.s3.model.NoSuchBucketException; import software.amazon.awssdk.testutils.RandomTempFile; import software.amazon.awssdk.transfer.s3.model.CompletedFileUpload; import software.amazon.awssdk.transfer.s3.model.CompletedUpload; @@ -148,20 +146,4 @@ void upload_file_Interupted_CancelsTheListener() throws IOException, Interrupted assertThat(transferListener.getRatioTransferredList().get(transferListener.getRatioTransferredList().size() - 1)) .isNotEqualTo(100.0); } - - @Test - void upload_file_errorPropagatedToListener() throws IOException, InterruptedException { - Map metadata = new HashMap<>(); - CaptureTransferListener transferListener = new CaptureTransferListener(); - metadata.put("x-amz-meta-foobar", "FOO BAR"); - FileUpload fileUpload = - tm.uploadFile(u -> u.putObjectRequest(p -> p.bucket(TEST_BUCKET+TEST_BUCKET).key(TEST_KEY).metadata(metadata).checksumAlgorithm(ChecksumAlgorithm.CRC32)) - .source(testFile.toPath()) - .addTransferListener(LoggingTransferListener.create()) - .addTransferListener(transferListener) - .build()); - assertThatExceptionOfType(CompletionException.class).isThrownBy( - () -> fileUpload.completionFuture().join()); - assertThat(transferListener.getExceptionCaught()).isInstanceOf(NoSuchBucketException.class); - } } diff --git a/services/s3/src/main/java/software/amazon/awssdk/services/s3/internal/crt/S3CrtResponseHandlerAdapter.java b/services/s3/src/main/java/software/amazon/awssdk/services/s3/internal/crt/S3CrtResponseHandlerAdapter.java index ec81d624351e..cff1a6b6193a 100644 --- a/services/s3/src/main/java/software/amazon/awssdk/services/s3/internal/crt/S3CrtResponseHandlerAdapter.java +++ b/services/s3/src/main/java/software/amazon/awssdk/services/s3/internal/crt/S3CrtResponseHandlerAdapter.java @@ -152,7 +152,6 @@ private void onErrorResponseComplete(byte[] errorPayload) { } private void failResponseHandlerAndFuture(Throwable exception) { - this.progressListener.subscriberOnError(exception); resultFuture.completeExceptionally(exception); runAndLogError(log.logger(), "Exception thrown in SdkAsyncHttpResponseHandler#onError, ignoring", () -> responseHandler.onError(exception));