60
60
import software .amazon .awssdk .core .internal .async .FileAsyncResponseTransformer ;
61
61
import software .amazon .awssdk .core .internal .async .InputStreamResponseTransformer ;
62
62
import software .amazon .awssdk .core .internal .async .PublisherAsyncResponseTransformer ;
63
+ import software .amazon .awssdk .core .internal .async .SplittingTransformer ;
63
64
import software .amazon .awssdk .http .nio .netty .NettyNioAsyncHttpClient ;
64
65
import software .amazon .awssdk .regions .Region ;
65
66
import software .amazon .awssdk .services .s3 .S3AsyncClient ;
@@ -142,7 +143,7 @@ public <T> void errorOnThirdPart_shouldCompleteExceptionallyOnlyPartsGreaterThan
142
143
}
143
144
144
145
@ ParameterizedTest
145
- @ MethodSource ("responseTransformers " )
146
+ @ MethodSource ("nonRetryableResponseTransformers " )
146
147
public <T > void errorOnFirstPart_shouldFail (AsyncResponseTransformerTestSupplier <T > supplier ) {
147
148
stubFor (get (urlEqualTo (String .format ("/%s/%s?partNumber=1" , BUCKET , KEY ))).willReturn (
148
149
aResponse ()
@@ -155,8 +156,8 @@ public <T> void errorOnFirstPart_shouldFail(AsyncResponseTransformerTestSupplier
155
156
}
156
157
157
158
@ 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 ) {
160
161
stubFor (get (urlEqualTo (String .format ("/%s/%s?partNumber=1" , BUCKET , KEY )))
161
162
.willReturn (aResponse ()
162
163
.withFault (Fault .CONNECTION_RESET_BY_PEER )));
@@ -175,7 +176,7 @@ public <T> void ioError_shouldFailAndNotRetry(AsyncResponseTransformerTestSuppli
175
176
}
176
177
177
178
@ ParameterizedTest
178
- @ MethodSource ("responseTransformers " )
179
+ @ MethodSource ("nonRetryableResponseTransformers " )
179
180
public void getObject_single500WithinMany200s_shouldNotRetryError (AsyncResponseTransformerTestSupplier <?> transformerSupplier ) {
180
181
List <CompletableFuture <?>> futures = new ArrayList <>();
181
182
@@ -243,14 +244,16 @@ private static Stream<Arguments> partSizeAndTransformerParams() {
243
244
244
245
245
246
/**
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
247
250
* {@link FileAsyncResponseTransformer}
248
251
* <p>
249
252
*
250
253
* Retry for multipart download is supported for {@link ByteArrayAsyncResponseTransformer}, tested in
251
254
* {@link S3MultipartClientGetObjectRetryBehaviorWiremockTest}.
252
255
*/
253
- private static Stream <AsyncResponseTransformerTestSupplier <?>> responseTransformers () {
256
+ private static Stream <AsyncResponseTransformerTestSupplier <?>> nonRetryableResponseTransformers () {
254
257
return Stream .of (new AsyncResponseTransformerTestSupplier .InputStreamArtSupplier (),
255
258
new AsyncResponseTransformerTestSupplier .PublisherArtSupplier (),
256
259
new AsyncResponseTransformerTestSupplier .FileArtSupplier ());
0 commit comments