diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2022-05-03 01:48:16 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 20:18:16 +0000 |
commit | c555609f164eb5245eb1cceb3fe22ec1d258ec5d (patch) | |
tree | 2a3dd02158fccfff2d92fe9c3ff433758a141076 /crypto-pgpainless/src/test/kotlin | |
parent | 07a83a33b878791257d1aa2282e71c1d2f301254 (diff) |
Misc cleanups (#1891)
Diffstat (limited to 'crypto-pgpainless/src/test/kotlin')
3 files changed, 16 insertions, 16 deletions
diff --git a/crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/GpgIdentifierTest.kt b/crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/GpgIdentifierTest.kt index 3860873c..aaf20cd8 100644 --- a/crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/GpgIdentifierTest.kt +++ b/crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/GpgIdentifierTest.kt @@ -12,28 +12,28 @@ import kotlin.test.assertTrue class GpgIdentifierTest { @Test - fun `parses hexadecimal key id without leading 0x`() { + fun parseHexKeyIdWithout0xPrefix() { val identifier = GpgIdentifier.fromString("79E8208280490C77") assertNotNull(identifier) assertTrue { identifier is GpgIdentifier.KeyId } } @Test - fun `parses hexadecimal key id`() { + fun parseHexKeyId() { val identifier = GpgIdentifier.fromString("0x79E8208280490C77") assertNotNull(identifier) assertTrue { identifier is GpgIdentifier.KeyId } } @Test - fun `parses email as user id`() { + fun parseValidEmail() { val identifier = GpgIdentifier.fromString("john.doe@example.org") assertNotNull(identifier) assertTrue { identifier is GpgIdentifier.UserId } } @Test - fun `parses user@host without TLD`() { + fun parseEmailWithoutTLD() { val identifier = GpgIdentifier.fromString("john.doe@example") assertNotNull(identifier) assertTrue { identifier is GpgIdentifier.UserId } diff --git a/crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/KeyUtilsTest.kt b/crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/KeyUtilsTest.kt index 14ac2263..33597f9f 100644 --- a/crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/KeyUtilsTest.kt +++ b/crypto-pgpainless/src/test/kotlin/dev/msfjarvis/aps/crypto/KeyUtilsTest.kt @@ -11,7 +11,7 @@ import org.bouncycastle.openpgp.PGPSecretKeyRing class KeyUtilsTest { @Test - fun `parse GPG key with multiple identities`() { + fun parseKeyWithMultipleIdentities() { val key = PGPKey(getArmoredPrivateKeyWithMultipleIdentities()) val keyring = tryParseKeyring(key) assertNotNull(keyring) 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 1439d52d..cf33b53f 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 @@ -51,7 +51,7 @@ class PGPKeyManagerTest { } @Test - fun testAddingKey() = + fun addKey() = scope.runTest { // Check if the key id returned is correct val keyId = keyManager.getKeyId(keyManager.addKey(key).unwrap()) @@ -66,7 +66,7 @@ class PGPKeyManagerTest { } @Test - fun testAddingKeyWithoutReplaceFlag() = + fun addKeyWithoutReplaceFlag() = scope.runTest { // Check adding the keys twice keyManager.addKey(key, false).unwrap() @@ -76,7 +76,7 @@ class PGPKeyManagerTest { } @Test - fun testAddingKeyWithReplaceFlag() = + fun addKeyWithReplaceFlag() = scope.runTest { // Check adding the keys twice keyManager.addKey(key, true).unwrap() @@ -86,7 +86,7 @@ class PGPKeyManagerTest { } @Test - fun testRemovingKey() = + fun removeKey() = scope.runTest { // Add key using KeyManager keyManager.addKey(key).unwrap() @@ -101,7 +101,7 @@ class PGPKeyManagerTest { } @Test - fun testGetExistingKeyById() = + fun getKeyById() = scope.runTest { // Add key using KeyManager keyManager.addKey(key).unwrap() @@ -116,7 +116,7 @@ class PGPKeyManagerTest { } @Test - fun testGetExistingKeyByFullUserId() = + fun getKeyByFullUserId() = scope.runTest { keyManager.addKey(key).unwrap() @@ -126,7 +126,7 @@ class PGPKeyManagerTest { } @Test - fun testGetExistingKeyByEmailUserId() = + fun getKeyByEmailUserId() = scope.runTest { keyManager.addKey(key).unwrap() @@ -136,7 +136,7 @@ class PGPKeyManagerTest { } @Test - fun testGetNonExistentKey() = + fun getNonExistentKey() = scope.runTest { // Add key using KeyManager keyManager.addKey(key).unwrap() @@ -150,7 +150,7 @@ class PGPKeyManagerTest { } @Test - fun testFindKeysWithoutAdding() = + fun findNonExistentKey() = scope.runTest { // Check returned key val error = keyManager.getKeyById(KeyId(0x08edf7567183ce44)).unwrapError() @@ -159,7 +159,7 @@ class PGPKeyManagerTest { } @Test - fun testGettingAllKeys() = + fun getAllKeys() = scope.runTest { // TODO: Should we check for more than 1 keys? // Check if KeyManager returns no key @@ -175,7 +175,7 @@ class PGPKeyManagerTest { } @Test - fun testGettingMultipleIdentityKeyWithBothUserIDs() { + fun getMultipleIdentityKeyWithAllIdentities() { scope.runTest { val key = PGPKey(getArmoredPrivateKeyWithMultipleIdentities()) keyManager.addKey(key).unwrap() |