Skip to content

Commit 2a2a700

Browse files
author
Alex Cioc
committed
Replace failing Assert.fails with assertThrows per earlier PR changes
1 parent e7439dc commit 2a2a700

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/test/java/com/amazonaws/encryptionsdk/AwsCryptoTest.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,10 @@ private void doTruncatedEncryptDecrypt(final CryptoAlgorithm cryptoAlg, final in
165165
plaintextBytes,
166166
encryptionContext).getResult();
167167
final byte[] truncatedCipherText = Arrays.copyOf(cipherText, cipherText.length - 1);
168-
try {
169-
encryptionClient_.decryptData(
170-
masterKeyProvider,
171-
truncatedCipherText
172-
).getResult();
173-
Assert.fail("Expected BadCiphertextException");
174-
} catch (final BadCiphertextException ex) {
175-
// Expected exception
176-
}
168+
169+
assertThrows(BadCiphertextException.class, () -> encryptionClient_.decryptData(
170+
masterKeyProvider,
171+
truncatedCipherText));
177172
}
178173

179174
private void doEncryptDecryptWithParsedCiphertext(final int byteSize, final int frameSize) {

0 commit comments

Comments
 (0)