Fix decrypt no signatures test

This commit is contained in:
Paul Schaub 2022-06-23 10:30:16 +02:00
parent bca359805b
commit 07f9c3ceef
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 6 additions and 4 deletions

View File

@ -166,18 +166,20 @@ public class EncryptDecryptRoundTripTest {
}
@Test
public void encrypt_decryptAndVerifyYieldsNoSignatureException() throws IOException {
public void encrypt_decryptAndVerifyYieldsNoVerifications() throws IOException {
byte[] encrypted = sop.encrypt()
.withCert(bobCert)
.plaintext(message)
.getBytes();
assertThrows(SOPGPException.NoSignature.class, () -> sop
.decrypt()
DecryptionResult result = sop.decrypt()
.withKey(bobKey)
.verifyWithCert(aliceCert)
.ciphertext(encrypted)
.toByteArrayAndResult());
.toByteArrayAndResult()
.getResult();
assertTrue(result.getVerifications().isEmpty());
}
@Test