@@ -122,7 +122,7 @@ void setUpEach() {
122
122
123
123
@ ParameterizedTest (name = "{0}" )
124
124
@ MethodSource ("basicFunctionalityTestData" )
125
- void given_validPresignedUrl_when_requestingObject_then_returnsContent (String testDescription ,
125
+ void getObject_withValidPresignedUrl_returnsContent (String testDescription ,
126
126
String objectKey ,
127
127
String expectedContent ) throws Exception {
128
128
PresignedUrlGetObjectRequest request = createRequestForKey (objectKey );
@@ -140,7 +140,7 @@ void given_validPresignedUrl_when_requestingObject_then_returnsContent(String te
140
140
}
141
141
142
142
@ Test
143
- void given_validPresignedUrl_when_downloadingToFile_then_savesContentToFile () throws Exception {
143
+ void getObject_withValidPresignedUrl_savesContentToFile () throws Exception {
144
144
PresignedUrlGetObjectRequest request = createRequestForKey (testGetObjectKey );
145
145
Path downloadFile = temporaryFolder .resolve ("download-" + UUID .randomUUID () + ".txt" );
146
146
CompletableFuture <GetObjectResponse > future =
@@ -153,7 +153,7 @@ void given_validPresignedUrl_when_downloadingToFile_then_savesContentToFile() th
153
153
}
154
154
155
155
@ Test
156
- void given_validPresignedUrl_when_usingConsumerBuilder_then_returnsContent () throws Exception {
156
+ void getObject_withConsumerBuilder_returnsContent () throws Exception {
157
157
URL presignedUrl = createPresignedUrl (testGetObjectKey );
158
158
159
159
CompletableFuture <ResponseBytes <GetObjectResponse >> bytesFuture =
@@ -179,7 +179,7 @@ void given_validPresignedUrl_when_usingConsumerBuilder_then_returnsContent() thr
179
179
180
180
@ ParameterizedTest (name = "{0}" )
181
181
@ MethodSource ("rangeTestData" )
182
- void given_validRangeRequest_when_requestingPartialContent_then_returnsSpecifiedRange (String testDescription ,
182
+ void getObject_withRangeRequest_returnsSpecifiedRange (String testDescription ,
183
183
String range ,
184
184
String expectedContent ) throws Exception {
185
185
PresignedUrlGetObjectRequest request = createRequestForKey (testGetObjectKey , range );
@@ -193,7 +193,7 @@ void given_validRangeRequest_when_requestingPartialContent_then_returnsSpecified
193
193
194
194
@ ParameterizedTest (name = "{0}" )
195
195
@ MethodSource ("errorHandlingTestData" )
196
- void given_invalidRequest_when_executingOperation_then_throwsExpectedException (String testDescription ,
196
+ void getObject_withInvalidRequest_throwsExpectedException (String testDescription ,
197
197
String errorType ,
198
198
Class <? extends Exception > expectedExceptionType ) throws Exception {
199
199
@@ -241,7 +241,7 @@ void given_invalidRequest_when_executingOperation_then_throwsExpectedException(S
241
241
}
242
242
243
243
@ Test
244
- void given_multipleRangeRequests_when_executingConcurrently_then_returnsCorrectContent () throws Exception {
244
+ void getObject_withMultipleRangeRequestsConcurrently_returnsCorrectContent () throws Exception {
245
245
String concurrentTestKey = uploadTestObject ("concurrent-test" , "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
246
246
List <CompletableFuture <ResponseBytes <GetObjectResponse >>> futures = new ArrayList <>();
247
247
@@ -271,7 +271,7 @@ void given_multipleRangeRequests_when_executingConcurrently_then_returnsCorrectC
271
271
}
272
272
273
273
@ Test
274
- void given_largeObject_when_requestingRanges_then_returnsCorrectChunks () throws Exception {
274
+ void getObject_withLargeObjectRanges_returnsCorrectChunks () throws Exception {
275
275
List <CompletableFuture <ResponseBytes <GetObjectResponse >>> futures = new ArrayList <>();
276
276
int chunkSize = 1024 * 1024 ;
277
277
@@ -300,7 +300,7 @@ void given_largeObject_when_requestingRanges_then_returnsCorrectChunks() throws
300
300
}
301
301
302
302
@ Test
303
- void given_largeObject_when_downloadingToFile_then_savesCompleteContent () throws Exception {
303
+ void getObject_withLargeObjectToFile_savesCompleteContent () throws Exception {
304
304
PresignedUrlGetObjectRequest request = createRequestForKey (testLargeObjectKey );
305
305
Path downloadFile = temporaryFolder .resolve ("large-download-" + UUID .randomUUID () + ".bin" );
306
306
CompletableFuture <GetObjectResponse > future =
@@ -313,7 +313,7 @@ void given_largeObject_when_downloadingToFile_then_savesCompleteContent() throws
313
313
}
314
314
315
315
@ Test
316
- void given_clientWithMetrics_when_executingRequest_then_collectsMetrics () throws Exception {
316
+ void getObject_withClientMetrics_collectsMetrics () throws Exception {
317
317
List <MetricCollection > collectedMetrics = new ArrayList <>();
318
318
MetricPublisher metricPublisher = new MetricPublisher () {
319
319
@ Override
@@ -341,7 +341,7 @@ public void close() {}
341
341
}
342
342
343
343
@ Test
344
- void given_presignedUrl_when_usingBuilderPattern_then_returnsContent () throws Exception {
344
+ void getObject_withBuilderPattern_returnsContent () throws Exception {
345
345
PresignedUrlGetObjectRequest request = PresignedUrlGetObjectRequest .builder ()
346
346
.presignedUrl (createPresignedUrl (testGetObjectKey ))
347
347
.build ();
@@ -355,38 +355,38 @@ void given_presignedUrl_when_usingBuilderPattern_then_returnsContent() throws Ex
355
355
356
356
static Stream <Arguments > basicFunctionalityTestData () {
357
357
return Stream .of (
358
- Arguments .of ("given_validUrl_when_requestingObject_then_returnsContent " ,
358
+ Arguments .of ("getObject_withValidUrl_returnsContent " ,
359
359
testGetObjectKey , testObjectContent ),
360
- Arguments .of ("given_validUrl_when_requestingLargeObject_then_returnsContent " ,
360
+ Arguments .of ("getObject_withValidLargeObjectUrl_returnsContent " ,
361
361
testLargeObjectKey , null ),
362
- Arguments .of ("given_validUrl_when_requestingWithBuilder_then_returnsContent " ,
362
+ Arguments .of ("getObject_withBuilderPattern_returnsContent " ,
363
363
testGetObjectKey , testObjectContent )
364
364
);
365
365
}
366
366
367
367
static Stream <Arguments > rangeTestData () {
368
368
String content = "Hello AsyncPresignedUrlManager Integration Test" ;
369
369
return Stream .of (
370
- Arguments .of ("given_validUrl_when_requestingPrefix10Bytes_then_returnsFirst10Bytes " ,
370
+ Arguments .of ("getObject_withPrefix10BytesRange_returnsFirst10Bytes " ,
371
371
"bytes=0-9" , content .substring (0 , 10 )),
372
- Arguments .of ("given_validUrl_when_requestingSuffix10Bytes_then_returnsLast10Bytes " ,
372
+ Arguments .of ("getObject_withSuffix10BytesRange_returnsLast10Bytes " ,
373
373
"bytes=-10" , content .substring (content .length () - 10 )),
374
- Arguments .of ("given_validUrl_when_requestingMiddle10Bytes_then_returnsMiddle10Bytes " ,
374
+ Arguments .of ("getObject_withMiddle10BytesRange_returnsMiddle10Bytes " ,
375
375
"bytes=10-19" , content .substring (10 , 20 )),
376
- Arguments .of ("given_validUrl_when_requestingSingleByte_then_returnsSingleByte " ,
376
+ Arguments .of ("getObject_withSingleByteRange_returnsSingleByte " ,
377
377
"bytes=0-0" , content .substring (0 , 1 ))
378
378
);
379
379
}
380
380
381
381
static Stream <Arguments > errorHandlingTestData () {
382
382
return Stream .of (
383
- Arguments .of ("given_nonExistentKey_when_requestingObject_then_throwsNoSuchKeyException " ,
383
+ Arguments .of ("getObject_withNonExistentKey_throwsNoSuchKeyException " ,
384
384
"nonExistentKey" , NoSuchKeyException .class ),
385
- Arguments .of ("given_invalidUrl_when_requestingObject_then_throwsS3Exception " ,
385
+ Arguments .of ("getObject_withInvalidUrl_throwsS3Exception " ,
386
386
"invalidUrl" , S3Exception .class ),
387
- Arguments .of ("given_expiredUrl_when_requestingObject_then_throwsS3Exception " ,
387
+ Arguments .of ("getObject_withExpiredUrl_throwsS3Exception " ,
388
388
"expiredUrl" , S3Exception .class ),
389
- Arguments .of ("given_malformedUrl_when_requestingObject_then_throwsIllegalArgumentException " ,
389
+ Arguments .of ("getObject_withMalformedUrl_throwsIllegalArgumentException " ,
390
390
"malformedUrl" , IllegalArgumentException .class )
391
391
);
392
392
}
0 commit comments