diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2022-04-24 21:25:34 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-24 15:55:34 +0000 |
commit | 62902ca80b2a0883d810518de8b1838f29a682eb (patch) | |
tree | af1bd10f0bc8d6fc9b18659ed4279f1d237b15e2 /crypto-pgpainless/src/test | |
parent | 599abd37e84486f254dddcbb894e77fbcb347d41 (diff) |
Reorganize crypto-common code and fix a couple minor bugs (#1868)
Diffstat (limited to 'crypto-pgpainless/src/test')
-rw-r--r-- | crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/PGPKeyManagerTest.kt | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/PGPKeyManagerTest.kt b/crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/PGPKeyManagerTest.kt index 650f3d89..1439d52d 100644 --- a/crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/PGPKeyManagerTest.kt +++ b/crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/PGPKeyManagerTest.kt @@ -5,6 +5,9 @@ import com.github.michaelbull.result.unwrapError import dev.msfjarvis.aps.crypto.GpgIdentifier.KeyId import dev.msfjarvis.aps.crypto.GpgIdentifier.UserId import dev.msfjarvis.aps.crypto.TestUtils.getArmoredPrivateKeyWithMultipleIdentities +import dev.msfjarvis.aps.crypto.errors.KeyAlreadyExistsException +import dev.msfjarvis.aps.crypto.errors.KeyNotFoundException +import dev.msfjarvis.aps.crypto.errors.NoKeysAvailableException import java.io.File import kotlin.test.AfterTest import kotlin.test.BeforeTest @@ -69,7 +72,7 @@ class PGPKeyManagerTest { keyManager.addKey(key, false).unwrap() val error = keyManager.addKey(key, false).unwrapError() - assertIs<KeyManagerException.KeyAlreadyExistsException>(error) + assertIs<KeyAlreadyExistsException>(error) } @Test @@ -142,7 +145,7 @@ class PGPKeyManagerTest { // Check returned key val error = keyManager.getKeyById(keyId).unwrapError() - assertIs<KeyManagerException.KeyNotFoundException>(error) + assertIs<KeyNotFoundException>(error) assertEquals("No key found with id: $keyId", error.message) } @@ -151,7 +154,7 @@ class PGPKeyManagerTest { scope.runTest { // Check returned key val error = keyManager.getKeyById(KeyId(0x08edf7567183ce44)).unwrapError() - assertIs<KeyManagerException.NoKeysAvailableException>(error) + assertIs<NoKeysAvailableException>(error) assertEquals("No keys were found", error.message) } |