Skip to content

Commit 320e8d8

Browse files
updated test method names to follow testing guidelines
1 parent 22e01ef commit 320e8d8

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

services/s3/src/it/java/software/amazon/awssdk/services/s3/presignedurl/AsyncPresignedUrlManagerTestSuite.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void setUpEach() {
122122

123123
@ParameterizedTest(name = "{0}")
124124
@MethodSource("basicFunctionalityTestData")
125-
void given_validPresignedUrl_when_requestingObject_then_returnsContent(String testDescription,
125+
void getObject_withValidPresignedUrl_returnsContent(String testDescription,
126126
String objectKey,
127127
String expectedContent) throws Exception {
128128
PresignedUrlGetObjectRequest request = createRequestForKey(objectKey);
@@ -140,7 +140,7 @@ void given_validPresignedUrl_when_requestingObject_then_returnsContent(String te
140140
}
141141

142142
@Test
143-
void given_validPresignedUrl_when_downloadingToFile_then_savesContentToFile() throws Exception {
143+
void getObject_withValidPresignedUrl_savesContentToFile() throws Exception {
144144
PresignedUrlGetObjectRequest request = createRequestForKey(testGetObjectKey);
145145
Path downloadFile = temporaryFolder.resolve("download-" + UUID.randomUUID() + ".txt");
146146
CompletableFuture<GetObjectResponse> future =
@@ -153,7 +153,7 @@ void given_validPresignedUrl_when_downloadingToFile_then_savesContentToFile() th
153153
}
154154

155155
@Test
156-
void given_validPresignedUrl_when_usingConsumerBuilder_then_returnsContent() throws Exception {
156+
void getObject_withConsumerBuilder_returnsContent() throws Exception {
157157
URL presignedUrl = createPresignedUrl(testGetObjectKey);
158158

159159
CompletableFuture<ResponseBytes<GetObjectResponse>> bytesFuture =
@@ -179,7 +179,7 @@ void given_validPresignedUrl_when_usingConsumerBuilder_then_returnsContent() thr
179179

180180
@ParameterizedTest(name = "{0}")
181181
@MethodSource("rangeTestData")
182-
void given_validRangeRequest_when_requestingPartialContent_then_returnsSpecifiedRange(String testDescription,
182+
void getObject_withRangeRequest_returnsSpecifiedRange(String testDescription,
183183
String range,
184184
String expectedContent) throws Exception {
185185
PresignedUrlGetObjectRequest request = createRequestForKey(testGetObjectKey, range);
@@ -193,7 +193,7 @@ void given_validRangeRequest_when_requestingPartialContent_then_returnsSpecified
193193

194194
@ParameterizedTest(name = "{0}")
195195
@MethodSource("errorHandlingTestData")
196-
void given_invalidRequest_when_executingOperation_then_throwsExpectedException(String testDescription,
196+
void getObject_withInvalidRequest_throwsExpectedException(String testDescription,
197197
String errorType,
198198
Class<? extends Exception> expectedExceptionType) throws Exception {
199199

@@ -241,7 +241,7 @@ void given_invalidRequest_when_executingOperation_then_throwsExpectedException(S
241241
}
242242

243243
@Test
244-
void given_multipleRangeRequests_when_executingConcurrently_then_returnsCorrectContent() throws Exception {
244+
void getObject_withMultipleRangeRequestsConcurrently_returnsCorrectContent() throws Exception {
245245
String concurrentTestKey = uploadTestObject("concurrent-test", "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ");
246246
List<CompletableFuture<ResponseBytes<GetObjectResponse>>> futures = new ArrayList<>();
247247

@@ -271,7 +271,7 @@ void given_multipleRangeRequests_when_executingConcurrently_then_returnsCorrectC
271271
}
272272

273273
@Test
274-
void given_largeObject_when_requestingRanges_then_returnsCorrectChunks() throws Exception {
274+
void getObject_withLargeObjectRanges_returnsCorrectChunks() throws Exception {
275275
List<CompletableFuture<ResponseBytes<GetObjectResponse>>> futures = new ArrayList<>();
276276
int chunkSize = 1024 * 1024;
277277

@@ -300,7 +300,7 @@ void given_largeObject_when_requestingRanges_then_returnsCorrectChunks() throws
300300
}
301301

302302
@Test
303-
void given_largeObject_when_downloadingToFile_then_savesCompleteContent() throws Exception {
303+
void getObject_withLargeObjectToFile_savesCompleteContent() throws Exception {
304304
PresignedUrlGetObjectRequest request = createRequestForKey(testLargeObjectKey);
305305
Path downloadFile = temporaryFolder.resolve("large-download-" + UUID.randomUUID() + ".bin");
306306
CompletableFuture<GetObjectResponse> future =
@@ -313,7 +313,7 @@ void given_largeObject_when_downloadingToFile_then_savesCompleteContent() throws
313313
}
314314

315315
@Test
316-
void given_clientWithMetrics_when_executingRequest_then_collectsMetrics() throws Exception {
316+
void getObject_withClientMetrics_collectsMetrics() throws Exception {
317317
List<MetricCollection> collectedMetrics = new ArrayList<>();
318318
MetricPublisher metricPublisher = new MetricPublisher() {
319319
@Override
@@ -341,7 +341,7 @@ public void close() {}
341341
}
342342

343343
@Test
344-
void given_presignedUrl_when_usingBuilderPattern_then_returnsContent() throws Exception {
344+
void getObject_withBuilderPattern_returnsContent() throws Exception {
345345
PresignedUrlGetObjectRequest request = PresignedUrlGetObjectRequest.builder()
346346
.presignedUrl(createPresignedUrl(testGetObjectKey))
347347
.build();
@@ -355,38 +355,38 @@ void given_presignedUrl_when_usingBuilderPattern_then_returnsContent() throws Ex
355355

356356
static Stream<Arguments> basicFunctionalityTestData() {
357357
return Stream.of(
358-
Arguments.of("given_validUrl_when_requestingObject_then_returnsContent",
358+
Arguments.of("getObject_withValidUrl_returnsContent",
359359
testGetObjectKey, testObjectContent),
360-
Arguments.of("given_validUrl_when_requestingLargeObject_then_returnsContent",
360+
Arguments.of("getObject_withValidLargeObjectUrl_returnsContent",
361361
testLargeObjectKey, null),
362-
Arguments.of("given_validUrl_when_requestingWithBuilder_then_returnsContent",
362+
Arguments.of("getObject_withBuilderPattern_returnsContent",
363363
testGetObjectKey, testObjectContent)
364364
);
365365
}
366366

367367
static Stream<Arguments> rangeTestData() {
368368
String content = "Hello AsyncPresignedUrlManager Integration Test";
369369
return Stream.of(
370-
Arguments.of("given_validUrl_when_requestingPrefix10Bytes_then_returnsFirst10Bytes",
370+
Arguments.of("getObject_withPrefix10BytesRange_returnsFirst10Bytes",
371371
"bytes=0-9", content.substring(0, 10)),
372-
Arguments.of("given_validUrl_when_requestingSuffix10Bytes_then_returnsLast10Bytes",
372+
Arguments.of("getObject_withSuffix10BytesRange_returnsLast10Bytes",
373373
"bytes=-10", content.substring(content.length() - 10)),
374-
Arguments.of("given_validUrl_when_requestingMiddle10Bytes_then_returnsMiddle10Bytes",
374+
Arguments.of("getObject_withMiddle10BytesRange_returnsMiddle10Bytes",
375375
"bytes=10-19", content.substring(10, 20)),
376-
Arguments.of("given_validUrl_when_requestingSingleByte_then_returnsSingleByte",
376+
Arguments.of("getObject_withSingleByteRange_returnsSingleByte",
377377
"bytes=0-0", content.substring(0, 1))
378378
);
379379
}
380380

381381
static Stream<Arguments> errorHandlingTestData() {
382382
return Stream.of(
383-
Arguments.of("given_nonExistentKey_when_requestingObject_then_throwsNoSuchKeyException",
383+
Arguments.of("getObject_withNonExistentKey_throwsNoSuchKeyException",
384384
"nonExistentKey", NoSuchKeyException.class),
385-
Arguments.of("given_invalidUrl_when_requestingObject_then_throwsS3Exception",
385+
Arguments.of("getObject_withInvalidUrl_throwsS3Exception",
386386
"invalidUrl", S3Exception.class),
387-
Arguments.of("given_expiredUrl_when_requestingObject_then_throwsS3Exception",
387+
Arguments.of("getObject_withExpiredUrl_throwsS3Exception",
388388
"expiredUrl", S3Exception.class),
389-
Arguments.of("given_malformedUrl_when_requestingObject_then_throwsIllegalArgumentException",
389+
Arguments.of("getObject_withMalformedUrl_throwsIllegalArgumentException",
390390
"malformedUrl", IllegalArgumentException.class)
391391
);
392392
}

0 commit comments

Comments
 (0)