Skip to content

Commit 90addf6

Browse files
author
Anirav Kareddy
committed
renamed exception being thrown
1 parent 40140e7 commit 90addf6

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,7 +1727,7 @@ public void testAesKeyringReEncryptInstructionFileEnforceRotationWithSameKey() {
17271727
ReEncryptInstructionFileResponse response = client.reEncryptInstructionFile(reEncryptInstructionFileRequest);
17281728
fail("Enforce rotation should throw exception");
17291729
} catch (S3EncryptionClientException e) {
1730-
assertTrue(e.getMessage().contains("Key rotation is not enforced! Old keyring is still able to decrypt the newly encrypted data key"));
1730+
assertTrue(e.getMessage().contains("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key"));
17311731
}
17321732

17331733
deleteObject(BUCKET, objectKey, client);
@@ -1851,7 +1851,7 @@ public void testRsaKeyringReEncryptInstructionFileEnforceRotationWithSameKey() {
18511851
ReEncryptInstructionFileResponse response = client.reEncryptInstructionFile(reEncryptInstructionFileRequest);
18521852
fail("Enforce rotation should throw exception");
18531853
} catch (S3EncryptionClientException e) {
1854-
assertTrue(e.getMessage().contains("Key rotation is not enforced! Old keyring is still able to decrypt the newly encrypted data key"));
1854+
assertTrue(e.getMessage().contains("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key"));
18551855
}
18561856

18571857
deleteObject(BUCKET, objectKey, client);
@@ -1981,7 +1981,7 @@ public void testRsaKeyringReEncryptInstructionFileWithCustomSuffixEnforceRotatio
19811981
ReEncryptInstructionFileResponse response = client.reEncryptInstructionFile(reEncryptInstructionFileRequest);
19821982
fail("Enforce rotation should throw exception");
19831983
} catch (S3EncryptionClientException e) {
1984-
assertTrue(e.getMessage().contains("Key rotation is not enforced! Old keyring is still able to decrypt the newly encrypted data key"));
1984+
assertTrue(e.getMessage().contains("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key"));
19851985
}
19861986

19871987
deleteObject(BUCKET, objectKey, client);
@@ -2129,7 +2129,7 @@ public void testAesKeyringReEncryptInstructionFileV1ToV3UpgradeEnforceRotationWi
21292129
ReEncryptInstructionFileResponse response = v3OriginalClient.reEncryptInstructionFile(reEncryptInstructionFileRequest);
21302130
fail("Enforce rotation should throw exception");
21312131
} catch (S3EncryptionClientException e) {
2132-
assertTrue(e.getMessage().contains("Key rotation is not enforced! Old keyring is still able to decrypt the newly encrypted data key"));
2132+
assertTrue(e.getMessage().contains("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key"));
21332133
}
21342134

21352135
deleteObject(BUCKET, objectKey, v3RotatedClient);
@@ -2198,7 +2198,7 @@ public void testAesKeyringReEncryptInstructionFileV2ToV3EnforceRotationWithSameK
21982198
ReEncryptInstructionFileResponse response = v3OriginalClient.reEncryptInstructionFile(reEncryptInstructionFileRequest);
21992199
fail("Enforce rotation should throw exception");
22002200
} catch (S3EncryptionClientException e) {
2201-
assertTrue(e.getMessage().contains("Key rotation is not enforced! Old keyring is still able to decrypt the newly encrypted data key"));
2201+
assertTrue(e.getMessage().contains("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key"));
22022202
}
22032203

22042204
deleteObject(BUCKET, objectKey, v3RotatedClient);
@@ -2420,7 +2420,7 @@ public void testRsaKeyringReEncryptInstructionFileWithCustomSuffixV2ToV3EnforceR
24202420
ReEncryptInstructionFileResponse response = v3OriginalClient.reEncryptInstructionFile(reEncryptInstructionFileRequest);
24212421
fail("Enforce rotation should throw exception");
24222422
} catch (S3EncryptionClientException e) {
2423-
assertTrue(e.getMessage().contains("Key rotation is not enforced! Old keyring is still able to decrypt the newly encrypted data key"));
2423+
assertTrue(e.getMessage().contains("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key"));
24242424
}
24252425

24262426
deleteObject(BUCKET, objectKey, v3OriginalClient);
@@ -2565,7 +2565,7 @@ public void testRsaKeyringReEncryptInstructionFileV2ToV3EnforceRotationWithSameK
25652565
ReEncryptInstructionFileResponse response = v3OriginalClient.reEncryptInstructionFile(reEncryptInstructionFileRequest);
25662566
fail("Enforce rotation should throw exception");
25672567
} catch (S3EncryptionClientException e) {
2568-
assertTrue(e.getMessage().contains("Key rotation is not enforced! Old keyring is still able to decrypt the newly encrypted data key"));
2568+
assertTrue(e.getMessage().contains("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key"));
25692569
}
25702570

25712571
deleteObject(BUCKET, objectKey, v3OriginalClient);
@@ -2723,7 +2723,7 @@ public void testRsaKeyringReEncryptInstructionFileV1ToV3EnforceRotationWithSameK
27232723
ReEncryptInstructionFileResponse response = v3OriginalClient.reEncryptInstructionFile(reEncryptInstructionFileRequest);
27242724
fail("Enforce rotation should throw exception");
27252725
} catch (S3EncryptionClientException e) {
2726-
assertTrue(e.getMessage().contains("Key rotation is not enforced! Old keyring is still able to decrypt the newly encrypted data key"));
2726+
assertTrue(e.getMessage().contains("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key"));
27272727
}
27282728

27292729
deleteObject(BUCKET, objectKey, v3OriginalClient);
@@ -2884,7 +2884,7 @@ public void testRsaKeyringReEncryptInstructionFileWithCustomSuffixV1ToV3EnforceR
28842884
ReEncryptInstructionFileResponse response = v3OriginalClient.reEncryptInstructionFile(reEncryptInstructionFileRequest);
28852885
fail("Enforce rotation should throw exception");
28862886
} catch (S3EncryptionClientException e) {
2887-
assertTrue(e.getMessage().contains("Key rotation is not enforced! Old keyring is still able to decrypt the newly encrypted data key"));
2887+
assertTrue(e.getMessage().contains("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key"));
28882888
}
28892889

28902890
deleteObject(BUCKET, objectKey, v3OriginalClient);
@@ -3045,7 +3045,7 @@ public void testRsaKeyringReEncryptInstructionFileWithCustomSuffixV1ToV3EnforceR
30453045
ReEncryptInstructionFileResponse response = v3OriginalClient.reEncryptInstructionFile(reEncryptInstructionFileRequest);
30463046
fail("Enforce rotation should throw exception");
30473047
} catch (S3EncryptionClientException e) {
3048-
assertTrue(e.getMessage().contains("Key rotation is not enforced! Old keyring is still able to decrypt the newly encrypted data key"));
3048+
assertTrue(e.getMessage().contains("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key"));
30493049
}
30503050

30513051
deleteObject(BUCKET, objectKey, v3OriginalClient);
@@ -3204,7 +3204,7 @@ public void testRsaKeyringReEncryptInstructionFileV1ToV3EnforceRotationWithSameK
32043204
ReEncryptInstructionFileResponse response = v3OriginalClient.reEncryptInstructionFile(reEncryptInstructionFileRequest);
32053205
fail("Enforce rotation should throw exception");
32063206
} catch (S3EncryptionClientException e) {
3207-
assertTrue(e.getMessage().contains("Key rotation is not enforced! Old keyring is still able to decrypt the newly encrypted data key"));
3207+
assertTrue(e.getMessage().contains("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key"));
32083208
}
32093209

32103210
deleteObject(BUCKET, objectKey, v3OriginalClient);
@@ -3352,7 +3352,7 @@ public void testAesKeyringReEncryptInstructionFileV1ToV3UpgradeEnforceRotationWi
33523352
ReEncryptInstructionFileResponse response = v3OriginalClient.reEncryptInstructionFile(reEncryptInstructionFileRequest);
33533353
fail("Enforce rotation should throw exception");
33543354
} catch (S3EncryptionClientException e) {
3355-
assertTrue(e.getMessage().contains("Key rotation is not enforced! Old keyring is still able to decrypt the newly encrypted data key"));
3355+
assertTrue(e.getMessage().contains("Re-encryption failed due to enforced rotation! Old keyring is still able to decrypt the newly encrypted data key"));
33563356
}
33573357

33583358
deleteObject(BUCKET, objectKey, v3RotatedClient);

0 commit comments

Comments
 (0)