1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-06-22 11:34:49 +02:00

Improve CachingBcPublicKeyDataDecryptorFactoryTest

This commit is contained in:
Paul Schaub 2022-11-23 20:07:42 +01:00
parent be7349f0b5
commit c72b3a4b8e

View file

@ -25,6 +25,8 @@ import org.pgpainless.key.info.KeyRingInfo;
import org.pgpainless.key.protection.SecretKeyRingProtector;
import org.pgpainless.key.protection.UnlockSecretKey;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class CachingBcPublicKeyDataDecryptorFactoryTest {
private static final String KEY = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" +
@ -83,7 +85,9 @@ public class CachingBcPublicKeyDataDecryptorFactoryTest {
ByteArrayOutputStream out = new ByteArrayOutputStream();
Streams.pipeAll(decryptionStream, out);
decryptionStream.close();
assertEquals("Hello, World!\n", out.toString());
ciphertextIn = new ByteArrayInputStream(MSG.getBytes());
decryptionStream = PGPainless.decryptAndOrVerify()
.onInputStream(ciphertextIn)
.withOptions(ConsumerOptions.get()
@ -91,5 +95,8 @@ public class CachingBcPublicKeyDataDecryptorFactoryTest {
out = new ByteArrayOutputStream();
Streams.pipeAll(decryptionStream, out);
decryptionStream.close();
assertEquals("Hello, World!\n", out.toString());
cachingFactory.clear();
}
}