6060import software .amazon .awssdk .core .internal .async .FileAsyncResponseTransformer ;
6161import software .amazon .awssdk .core .internal .async .InputStreamResponseTransformer ;
6262import software .amazon .awssdk .core .internal .async .PublisherAsyncResponseTransformer ;
63+ import software .amazon .awssdk .core .internal .async .SplittingTransformer ;
6364import software .amazon .awssdk .http .nio .netty .NettyNioAsyncHttpClient ;
6465import software .amazon .awssdk .regions .Region ;
6566import software .amazon .awssdk .services .s3 .S3AsyncClient ;
@@ -142,7 +143,7 @@ public <T> void errorOnThirdPart_shouldCompleteExceptionallyOnlyPartsGreaterThan
142143 }
143144
144145 @ ParameterizedTest
145- @ MethodSource ("responseTransformers " )
146+ @ MethodSource ("nonRetryableResponseTransformers " )
146147 public <T > void errorOnFirstPart_shouldFail (AsyncResponseTransformerTestSupplier <T > supplier ) {
147148 stubFor (get (urlEqualTo (String .format ("/%s/%s?partNumber=1" , BUCKET , KEY ))).willReturn (
148149 aResponse ()
@@ -155,8 +156,8 @@ public <T> void errorOnFirstPart_shouldFail(AsyncResponseTransformerTestSupplier
155156 }
156157
157158 @ ParameterizedTest
158- @ MethodSource ("responseTransformers " )
159- public <T > void ioError_shouldFailAndNotRetry (AsyncResponseTransformerTestSupplier <T > supplier ) {
159+ @ MethodSource ("nonRetryableResponseTransformers " )
160+ public <T > void nonRetryableResponseTransformers_ioErrorOnFirstPart_shouldFailAndNotRetry (AsyncResponseTransformerTestSupplier <T > supplier ) {
160161 stubFor (get (urlEqualTo (String .format ("/%s/%s?partNumber=1" , BUCKET , KEY )))
161162 .willReturn (aResponse ()
162163 .withFault (Fault .CONNECTION_RESET_BY_PEER )));
@@ -175,7 +176,7 @@ public <T> void ioError_shouldFailAndNotRetry(AsyncResponseTransformerTestSuppli
175176 }
176177
177178 @ ParameterizedTest
178- @ MethodSource ("responseTransformers " )
179+ @ MethodSource ("nonRetryableResponseTransformers " )
179180 public void getObject_single500WithinMany200s_shouldNotRetryError (AsyncResponseTransformerTestSupplier <?> transformerSupplier ) {
180181 List <CompletableFuture <?>> futures = new ArrayList <>();
181182
@@ -243,14 +244,16 @@ private static Stream<Arguments> partSizeAndTransformerParams() {
243244
244245
245246 /**
246- * Testing {@link PublisherAsyncResponseTransformer}, {@link InputStreamResponseTransformer}, and
247+ * Testing response transformers that are not retryable when
248+ * {@link AsyncResponseTransformer#split(SplittingTransformerConfiguration)} is invoked and used with
249+ * {@link SplittingTransformer} - {@link PublisherAsyncResponseTransformer}, {@link InputStreamResponseTransformer}, and
247250 * {@link FileAsyncResponseTransformer}
248251 * <p>
249252 *
250253 * Retry for multipart download is supported for {@link ByteArrayAsyncResponseTransformer}, tested in
251254 * {@link S3MultipartClientGetObjectRetryBehaviorWiremockTest}.
252255 */
253- private static Stream <AsyncResponseTransformerTestSupplier <?>> responseTransformers () {
256+ private static Stream <AsyncResponseTransformerTestSupplier <?>> nonRetryableResponseTransformers () {
254257 return Stream .of (new AsyncResponseTransformerTestSupplier .InputStreamArtSupplier (),
255258 new AsyncResponseTransformerTestSupplier .PublisherArtSupplier (),
256259 new AsyncResponseTransformerTestSupplier .FileArtSupplier ());
0 commit comments