aboutsummaryrefslogtreecommitdiff
path: root/crypto-pgpainless
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2022-11-07 21:21:59 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2022-11-07 21:21:59 +0530
commit56af2c936b60fbc101911d8acf49524d81ba1491 (patch)
tree356e66a72a8e146b4cbaf1dd385c587f3190817e /crypto-pgpainless
parent098d7047af70eef64c64530eeb7cd86d99b54953 (diff)
fix(crypto-pgpainless): pass test parameter directly where needed
Prevents unnecessary runs of tests that don't use the parameter
Diffstat (limited to 'crypto-pgpainless')
-rw-r--r--crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt
index 8e65cc83..4bb08a2c 100644
--- a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt
+++ b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandlerTest.kt
@@ -2,6 +2,7 @@
* Copyright © 2014-2021 The Android Password Store Authors. All Rights Reserved.
* SPDX-License-Identifier: GPL-3.0-only
*/
+@file:Suppress("JUnitMalformedDeclaration") // The test runner takes care of it
package app.passwordstore.crypto
@@ -30,12 +31,11 @@ enum class EncryptionKey(val keySet: List<PGPKey>) {
@RunWith(TestParameterInjector::class)
class PGPainlessCryptoHandlerTest {
- @TestParameter private lateinit var encryptionKey: EncryptionKey
private val cryptoHandler = PGPainlessCryptoHandler()
private val secretKey = PGPKey(TestUtils.getArmoredSecretKey())
@Test
- fun encryptAndDecrypt() {
+ fun encryptAndDecrypt(@TestParameter encryptionKey: EncryptionKey) {
val ciphertextStream = ByteArrayOutputStream()
val encryptRes =
cryptoHandler.encrypt(
@@ -59,7 +59,7 @@ class PGPainlessCryptoHandlerTest {
}
@Test
- fun decryptWithWrongPassphrase() {
+ fun decryptWithWrongPassphrase(@TestParameter encryptionKey: EncryptionKey) {
val ciphertextStream = ByteArrayOutputStream()
val encryptRes =
cryptoHandler.encrypt(
@@ -83,7 +83,7 @@ class PGPainlessCryptoHandlerTest {
}
@Test
- fun encryptAsciiArmored() {
+ fun encryptAsciiArmored(@TestParameter encryptionKey: EncryptionKey) {
val ciphertextStream = ByteArrayOutputStream()
val encryptRes =
cryptoHandler.encrypt(