Skip to content

Commit f7dd5ae

Browse files
retry
1 parent 8909abd commit f7dd5ae

File tree

52 files changed

+472
-472
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+472
-472
lines changed

src/test/java/software/amazon/encryption/s3/AdditionalDecryptionKeyMaterialTest.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public static void setUp() throws NoSuchAlgorithmException {
6565
* Test AES keyring with null additionalDecryptionKeyMaterial map.
6666
* This tests the default behavior when no additional key material is provided.
6767
*/
68-
@Test
68+
@RetryingTest(3)
6969
public void testAesKeyringWithNullAdditionalKeyMaterial() {
7070
final String objectKey = appendTestSuffix("aes-null-additional-key-material");
7171
final String input = "AES with null additional key material";
@@ -129,7 +129,7 @@ public void testAesKeyringWithNullAdditionalKeyMaterial() {
129129
* Test AES keyring with empty additionalDecryptionKeyMaterial map.
130130
* This tests the behavior when an empty map is provided.
131131
*/
132-
@Test
132+
@RetryingTest(3)
133133
public void testAesKeyringWithEmptyAdditionalKeyMaterial() {
134134
final String objectKey = appendTestSuffix("aes-empty-additional-key-material");
135135
final String input = "AES with empty additional key material";
@@ -194,7 +194,7 @@ public void testAesKeyringWithEmptyAdditionalKeyMaterial() {
194194
* Test AES keyring with a singleton additionalDecryptionKeyMaterial map.
195195
* This tests the behavior when a single additional key material is provided.
196196
*/
197-
@Test
197+
@RetryingTest(3)
198198
public void testAesKeyringWithSingletonAdditionalKeyMaterial() {
199199
final String objectKey = appendTestSuffix("aes-singleton-additional-key-material");
200200
final String input = "AES with singleton additional key material";
@@ -265,7 +265,7 @@ public void testAesKeyringWithSingletonAdditionalKeyMaterial() {
265265
* Test AES keyring with multiple entries in the additionalDecryptionKeyMaterial map.
266266
* This tests the behavior when multiple additional key materials are provided.
267267
*/
268-
@Test
268+
@RetryingTest(3)
269269
public void testAesKeyringWithMultipleAdditionalKeyMaterials() {
270270
final String objectKey = appendTestSuffix("aes-multiple-additional-key-materials");
271271
final String input = "AES with multiple additional key materials";
@@ -348,7 +348,7 @@ public void testAesKeyringWithMultipleAdditionalKeyMaterials() {
348348
* Test AES keyring with additionalDecryptionKeyMaterial that doesn't match.
349349
* This tests the behavior when no matching key material is found and it should fall back to the default key.
350350
*/
351-
@Test
351+
@RetryingTest(3)
352352
public void testAesKeyringWithNonMatchingAdditionalKeyMaterial() {
353353
final String objectKey = appendTestSuffix("aes-non-matching-additional-key-material");
354354
final String input = "AES with non-matching additional key material";
@@ -423,7 +423,7 @@ public void testAesKeyringWithNonMatchingAdditionalKeyMaterial() {
423423
* Test AES keyring with additionalDecryptionKeyMaterial that doesn't match and a wrong default key.
424424
* This tests the behavior when no matching key material is found and the default key is also wrong.
425425
*/
426-
@Test
426+
@RetryingTest(3)
427427
public void testAesKeyringWithNonMatchingAdditionalKeyMaterialAndWrongDefaultKey() {
428428
final String objectKey = appendTestSuffix("aes-non-matching-additional-key-material-wrong-default");
429429
final String input = "AES with non-matching additional key material and wrong default key";
@@ -494,7 +494,7 @@ public void testAesKeyringWithNonMatchingAdditionalKeyMaterialAndWrongDefaultKey
494494
* Test RSA keyring with null additionalDecryptionKeyMaterial map.
495495
* This tests the default behavior when no additional key material is provided.
496496
*/
497-
@Test
497+
@RetryingTest(3)
498498
public void testRsaKeyringWithNullAdditionalKeyMaterial() {
499499
final String objectKey = appendTestSuffix("rsa-null-additional-key-material");
500500
final String input = "RSA with null additional key material";
@@ -564,7 +564,7 @@ public void testRsaKeyringWithNullAdditionalKeyMaterial() {
564564
* Test RSA keyring with empty additionalDecryptionKeyMaterial map.
565565
* This tests the behavior when an empty map is provided.
566566
*/
567-
@Test
567+
@RetryingTest(3)
568568
public void testRsaKeyringWithEmptyAdditionalKeyMaterial() {
569569
final String objectKey = appendTestSuffix("rsa-empty-additional-key-material");
570570
final String input = "RSA with empty additional key material";
@@ -635,7 +635,7 @@ public void testRsaKeyringWithEmptyAdditionalKeyMaterial() {
635635
* Test RSA keyring with a singleton additionalDecryptionKeyMaterial map.
636636
* This tests the behavior when a single additional key material is provided.
637637
*/
638-
@Test
638+
@RetryingTest(3)
639639
public void testRsaKeyringWithSingletonAdditionalKeyMaterial() {
640640
final String objectKey = appendTestSuffix("rsa-singleton-additional-key-material");
641641
final String input = "RSA with singleton additional key material";
@@ -715,7 +715,7 @@ public void testRsaKeyringWithSingletonAdditionalKeyMaterial() {
715715
* Test RSA keyring with multiple entries in the additionalDecryptionKeyMaterial map.
716716
* This tests the behavior when multiple additional key materials are provided.
717717
*/
718-
@Test
718+
@RetryingTest(3)
719719
public void testRsaKeyringWithMultipleAdditionalKeyMaterials() {
720720
final String objectKey = appendTestSuffix("rsa-multiple-additional-key-materials");
721721
final String input = "RSA with multiple additional key materials";
@@ -810,7 +810,7 @@ public void testRsaKeyringWithMultipleAdditionalKeyMaterials() {
810810
* Test RSA keyring with additionalDecryptionKeyMaterial that doesn't match.
811811
* This tests the behavior when no matching key material is found and it should fall back to the default key.
812812
*/
813-
@Test
813+
@RetryingTest(3)
814814
public void testRsaKeyringWithNonMatchingAdditionalKeyMaterial() {
815815
final String objectKey = appendTestSuffix("rsa-non-matching-additional-key-material");
816816
final String input = "RSA with non-matching additional key material";
@@ -894,7 +894,7 @@ public void testRsaKeyringWithNonMatchingAdditionalKeyMaterial() {
894894
* Test RSA keyring with additionalDecryptionKeyMaterial that doesn't match and a wrong default key.
895895
* This tests the behavior when no matching key material is found and the default key is also wrong.
896896
*/
897-
@Test
897+
@RetryingTest(3)
898898
public void testRsaKeyringWithNonMatchingAdditionalKeyMaterialAndWrongDefaultKey() {
899899
final String objectKey = appendTestSuffix("rsa-non-matching-additional-key-material-wrong-default");
900900
final String input = "RSA with non-matching additional key material and wrong default key";

src/test/java/software/amazon/encryption/s3/ParameterMalleabilityTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void setUp() throws NoSuchAlgorithmException {
3030
AES_KEY = keyGen.generateKey();
3131
}
3232

33-
@Test
33+
@RetryingTest(3)
3434
public void contentEncryptionDowngradeAttackFails() {
3535
final String objectKey = appendTestSuffix("content-downgrade-attack-fails");
3636
S3Client s3Client = S3EncryptionClient.builderV4()
@@ -74,7 +74,7 @@ public void contentEncryptionDowngradeAttackFails() {
7474
s3Client.close();
7575
}
7676

77-
@Test
77+
@RetryingTest(3)
7878
public void keyWrapRemovalAttackFails() {
7979
final String objectKey = appendTestSuffix("keywrap-removal-attack-fails");
8080
S3Client s3Client = S3EncryptionClient.builderV4()
@@ -116,7 +116,7 @@ public void keyWrapRemovalAttackFails() {
116116
s3Client.close();
117117
}
118118

119-
@Test
119+
@RetryingTest(3)
120120
public void keyWrapDowngradeAesWrapAttackFails() {
121121
final String objectKey = appendTestSuffix("keywrap-downgrade-aeswrap-attack-fails");
122122
S3Client s3Client = S3EncryptionClient.builderV4()
@@ -159,7 +159,7 @@ public void keyWrapDowngradeAesWrapAttackFails() {
159159
s3Client.close();
160160
}
161161

162-
@Test
162+
@RetryingTest(3)
163163
public void keyWrapDowngradeAesAttackFails() {
164164
final String objectKey = appendTestSuffix("keywrap-downgrade-aes-attack-fails");
165165
S3Client s3Client = S3EncryptionClient.builderV4()

src/test/java/software/amazon/encryption/s3/S3AsyncEncryptionClientTest.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static void setUp() throws NoSuchAlgorithmException {
9696
PROVIDER = Security.getProvider("BC");
9797
}
9898

99-
@Test
99+
@RetryingTest(3)
100100
public void asyncCustomConfiguration() {
101101
final String objectKey = appendTestSuffix("wrapped-s3-client-with-custom-credentials-async");
102102

@@ -145,7 +145,7 @@ public void asyncCustomConfiguration() {
145145
s3Client.close();
146146
}
147147

148-
@Test
148+
@RetryingTest(3)
149149
public void asyncTopLevelConfigurationAllOptions() {
150150
final String objectKey = appendTestSuffix("async-top-level-all-options");
151151
AwsCredentialsProvider creds = DefaultCredentialsProvider.create();
@@ -192,7 +192,7 @@ public void asyncTopLevelConfigurationAllOptions() {
192192
s3Client.close();
193193
}
194194

195-
@Test
195+
@RetryingTest(3)
196196
public void asyncTopLevelConfiguration() {
197197
final String objectKey = appendTestSuffix("wrapped-s3-client-with-top-level-credentials-async");
198198

@@ -225,7 +225,7 @@ public void asyncTopLevelConfiguration() {
225225
s3Client.close();
226226
}
227227

228-
@Test
228+
@RetryingTest(3)
229229
public void s3AsyncEncryptionClientTopLevelAlternateCredentials() {
230230
final String objectKey = appendTestSuffix("wrapped-s3-async-client-with-top-level-alternate-credentials");
231231
final String input = "S3EncryptionClientTopLevelAlternateCredsTest";
@@ -279,7 +279,7 @@ public void s3AsyncEncryptionClientTopLevelAlternateCredentials() {
279279
s3ClientAltCreds.close();
280280
}
281281

282-
@Test
282+
@RetryingTest(3)
283283
public void s3AsyncEncryptionClientMixedCredentials() {
284284
final String objectKey = appendTestSuffix("wrapped-s3-client-with-mixed-credentials");
285285
final String input = "S3EncryptionClientTopLevelAlternateCredsTest";
@@ -321,7 +321,7 @@ public void s3AsyncEncryptionClientMixedCredentials() {
321321
kmsClient.close();
322322
}
323323

324-
@Test
324+
@RetryingTest(3)
325325
public void asyncTopLevelConfigurationWrongRegion() {
326326
final String objectKey = appendTestSuffix("wrapped-s3-client-with-wrong-region-credentials-async");
327327

@@ -349,7 +349,7 @@ public void asyncTopLevelConfigurationWrongRegion() {
349349
}
350350
}
351351

352-
@Test
352+
@RetryingTest(3)
353353
public void asyncTopLevelConfigurationNullCreds() {
354354
final String objectKey = appendTestSuffix("wrapped-s3-client-with-null-credentials-async");
355355

@@ -377,7 +377,7 @@ public void asyncTopLevelConfigurationNullCreds() {
377377
}
378378
}
379379

380-
@Test
380+
@RetryingTest(3)
381381
public void putAsyncGetDefault() {
382382
final String objectKey = appendTestSuffix("put-async-get-default");
383383

@@ -410,7 +410,7 @@ public void putAsyncGetDefault() {
410410
s3AsyncClient.close();
411411
}
412412

413-
@Test
413+
@RetryingTest(3)
414414
public void putDefaultGetAsync() {
415415
final String objectKey = appendTestSuffix("put-default-get-async");
416416

@@ -443,7 +443,7 @@ public void putDefaultGetAsync() {
443443
s3AsyncClient.close();
444444
}
445445

446-
@Test
446+
@RetryingTest(3)
447447
public void putAsyncGetAsync() {
448448
final String objectKey = appendTestSuffix("put-async-get-async");
449449

@@ -473,7 +473,7 @@ public void putAsyncGetAsync() {
473473
s3AsyncClient.close();
474474
}
475475

476-
@Test
476+
@RetryingTest(3)
477477
public void aesCbcV1toV3Async() {
478478
final String objectKey = appendTestSuffix("aes-cbc-v1-to-v3-async");
479479

@@ -512,7 +512,7 @@ public void aesCbcV1toV3Async() {
512512
s3Client.close();
513513
}
514514

515-
@Test
515+
@RetryingTest(3)
516516
public void failAesCbcV1toV3AsyncWhenDisabled() {
517517
final String objectKey = appendTestSuffix("fail-aes-cbc-v1-to-v3-async-when-disabled");
518518

@@ -549,7 +549,7 @@ public void failAesCbcV1toV3AsyncWhenDisabled() {
549549
s3Client.close();
550550
}
551551

552-
@Test
552+
@RetryingTest(3)
553553
public void AsyncAesGcmV2toV3WithInstructionFile() {
554554
final String objectKey = appendTestSuffix("async-aes-gcm-v2-to-v3-with-instruction-file");
555555

@@ -588,7 +588,7 @@ public void AsyncAesGcmV2toV3WithInstructionFile() {
588588
s3AsyncClient.close();
589589
}
590590

591-
@Test
591+
@RetryingTest(3)
592592
public void deleteObjectWithInstructionFileSuccessAsync() {
593593
final String objectKey = appendTestSuffix("async-delete-object-with-instruction-file");
594594

@@ -631,7 +631,7 @@ public void deleteObjectWithInstructionFileSuccessAsync() {
631631
defaultClient.close();
632632
}
633633

634-
@Test
634+
@RetryingTest(3)
635635
public void deleteObjectsWithInstructionFilesSuccessAsync() {
636636
final String[] objectKeys = {appendTestSuffix("async-delete-object-with-instruction-file-1"),
637637
appendTestSuffix("async-delete-object-with-instruction-file-2"),
@@ -680,7 +680,7 @@ public void deleteObjectsWithInstructionFilesSuccessAsync() {
680680
defaultClient.close();
681681
}
682682

683-
@Test
683+
@RetryingTest(3)
684684
public void deleteObjectWithWrongObjectKeySuccessAsync() {
685685
// V3 Client
686686
S3AsyncClient s3Client = S3AsyncEncryptionClient.builderV4()
@@ -692,7 +692,7 @@ public void deleteObjectWithWrongObjectKeySuccessAsync() {
692692
s3Client.close();
693693
}
694694

695-
@Test
695+
@RetryingTest(3)
696696
public void copyObjectTransparentlyAsync() {
697697
final String objectKey = appendTestSuffix("copy-object-from-here-async");
698698
final String newObjectKey = appendTestSuffix("copy-object-to-here-async");
@@ -741,7 +741,7 @@ public void copyObjectTransparentlyAsync() {
741741
* to be logged when debug logging is enabled.
742742
* @throws IOException
743743
*/
744-
@Test
744+
@RetryingTest(3)
745745
public void tinyBufferTest() throws IOException {
746746
// BouncyCastle actually returns null buffers, unlike ACCP and SunJCE, which return empty buffers
747747
Security.addProvider(new BouncyCastleProvider());
@@ -781,7 +781,7 @@ public void tinyBufferTest() throws IOException {
781781
exec.shutdown();
782782
}
783783

784-
@Test
784+
@RetryingTest(3)
785785
public void testAsyncInstructionFileConfig() {
786786
final String objectKey = appendTestSuffix("async-instruction-file-config");
787787
final String input = "SimpleTestOfV3EncryptionClient";
@@ -841,7 +841,7 @@ public void testAsyncInstructionFileConfig() {
841841
s3ClientDisabledInstructionFile.close();
842842
s3Client.close();
843843
}
844-
@Test
844+
@RetryingTest(3)
845845
public void testAsyncInstructionFileConfigMultipart() {
846846
final String objectKey = appendTestSuffix("test-multipart-async-instruction-file-config");
847847
final String input = "SimpleTestOfV3EncryptionClient";
@@ -885,7 +885,7 @@ public void testAsyncInstructionFileConfigMultipart() {
885885

886886
s3Client.close();
887887
}
888-
@Test
888+
@RetryingTest(3)
889889
public void testAsyncInstructionFileConfigMultipartWithOptions() {
890890
final String objectKey = appendTestSuffix("test-multipart-async-instruction-file-config-options");
891891
final String input = "SimpleTestOfV3EncryptionClient";
@@ -934,7 +934,7 @@ public void testAsyncInstructionFileConfigMultipartWithOptions() {
934934

935935
}
936936

937-
@Test
937+
@RetryingTest(3)
938938
public void wrappedClientMultipartUploadThrowsException() throws IOException {
939939
final String objectKey = appendTestSuffix("multipart-put-object-async-wrapped-client");
940940

@@ -1013,21 +1013,21 @@ public void wrappedClientMultipartUploadThrowsException() throws IOException {
10131013
s3Client.close();
10141014
}
10151015

1016-
@Test
1016+
@RetryingTest(3)
10171017
public void s3AsyncClientBuilderForbidsMultipartEnabled() {
10181018
assertThrows(
10191019
UnsupportedOperationException.class,
10201020
() -> S3AsyncEncryptionClient.builderV4().multipartEnabled(Boolean.TRUE));
10211021
}
10221022

1023-
@Test
1023+
@RetryingTest(3)
10241024
public void s3AsyncClientBuilderForbidsMultipartConfiguration() {
10251025
assertThrows(
10261026
UnsupportedOperationException.class,
10271027
() -> S3AsyncEncryptionClient.builderV4().multipartConfiguration(MultipartConfiguration.builder().build()));
10281028
}
10291029

1030-
@Test
1030+
@RetryingTest(3)
10311031
public void s3AsyncClientForbidsCreateMultipartUpload() {
10321032
S3AsyncClient s3AsyncClient = S3AsyncEncryptionClient.builderV4()
10331033
.kmsKeyId("fails")
@@ -1037,7 +1037,7 @@ public void s3AsyncClientForbidsCreateMultipartUpload() {
10371037
s3AsyncClient.close();
10381038
}
10391039

1040-
@Test
1040+
@RetryingTest(3)
10411041
public void s3AsyncClientForbidsUploadPart() {
10421042
S3AsyncClient s3AsyncClient = S3AsyncEncryptionClient.builderV4()
10431043
.kmsKeyId("fails")
@@ -1047,7 +1047,7 @@ public void s3AsyncClientForbidsUploadPart() {
10471047
s3AsyncClient.close();
10481048
}
10491049

1050-
@Test
1050+
@RetryingTest(3)
10511051
public void s3AsyncClientForbidsCompleteMultipartUpload() {
10521052
S3AsyncClient s3AsyncClient = S3AsyncEncryptionClient.builderV4()
10531053
.kmsKeyId("fails")

0 commit comments

Comments
 (0)