mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-14 12:49:39 +02:00
SubkeyIdentifier: Throw NoSuchElementException for non-existent subkey
This commit is contained in:
parent
1327e08ac3
commit
e4fdc3bc1e
2 changed files with 15 additions and 1 deletions
|
@ -17,8 +17,10 @@ package org.pgpainless.key;
|
|||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
|
@ -110,4 +112,9 @@ public class SubkeyIdentifierTest {
|
|||
assertNotEquals(id1, PRIMARY_FP);
|
||||
assertNotEquals(id1, null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nonExistentSubkeyThrowsNoSuchElementException() {
|
||||
assertThrows(NoSuchElementException.class, () -> new SubkeyIdentifier(CERT, 123));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue