1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-12 11:49:38 +02:00

EncryptionOptions.addRecipients(collection): Disallow empty collections

Fixes #281
This commit is contained in:
Paul Schaub 2022-04-29 22:49:45 +02:00
parent 51cd75533b
commit b980fcd7b1
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 14 additions and 0 deletions

View file

@ -116,6 +116,14 @@ public class EncryptionOptionsTest {
assertTrue(encryptionKeys.contains(encryptStorage));
}
@Test
public void testAddEmptyRecipientsFails() {
EncryptionOptions options = new EncryptionOptions();
assertThrows(IllegalArgumentException.class, () -> options.addRecipients(Collections.emptyList()));
assertThrows(IllegalArgumentException.class, () -> options.addRecipients(Collections.emptyList(),
encryptionCapableKeys -> encryptionCapableKeys));
}
@Test
public void testAddEmptyPassphraseFails() {
EncryptionOptions options = new EncryptionOptions();