1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-23 12:52:07 +01:00

Rename TestUtil -> TestImplementationFactoryProvider

This commit is contained in:
Paul Schaub 2021-07-03 12:42:12 +02:00
parent 9ac4b30ec7
commit 63c75f1f86
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
30 changed files with 52 additions and 52 deletions

View file

@ -52,7 +52,7 @@ public class DecryptAndVerifyMessageTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void decryptMessageAndVerifySignatureTest(ImplementationFactory implementationFactory) throws Exception { public void decryptMessageAndVerifySignatureTest(ImplementationFactory implementationFactory) throws Exception {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
String encryptedMessage = TestKeys.MSG_SIGN_CRYPT_JULIET_JULIET; String encryptedMessage = TestKeys.MSG_SIGN_CRYPT_JULIET_JULIET;

View file

@ -38,7 +38,7 @@ import org.pgpainless.key.info.KeyRingInfo;
public class DecryptHiddenRecipientMessage { public class DecryptHiddenRecipientMessage {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testDecryptionWithWildcardRecipient(ImplementationFactory implementationFactory) throws IOException, PGPException { public void testDecryptionWithWildcardRecipient(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
String secretKeyAscii = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" + String secretKeyAscii = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" +

View file

@ -131,7 +131,7 @@ public class ModificationDetectionTests {
* @throws PGPException in case of a pgp error * @throws PGPException in case of a pgp error
*/ */
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testMissingMDC(ImplementationFactory implementationFactory) throws IOException, PGPException { public void testMissingMDC(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
String message = "-----BEGIN PGP MESSAGE-----\n" + String message = "-----BEGIN PGP MESSAGE-----\n" +
@ -166,7 +166,7 @@ public class ModificationDetectionTests {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void tamperedCiphertextTest(ImplementationFactory implementationFactory) throws IOException, PGPException { public void tamperedCiphertextTest(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
String message = "-----BEGIN PGP MESSAGE-----\n" + String message = "-----BEGIN PGP MESSAGE-----\n" +
@ -197,7 +197,7 @@ public class ModificationDetectionTests {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void tamperedMDCTest(ImplementationFactory implementationFactory) throws IOException, PGPException { public void tamperedMDCTest(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
String message = "-----BEGIN PGP MESSAGE-----\n" + String message = "-----BEGIN PGP MESSAGE-----\n" +

View file

@ -38,7 +38,7 @@ public class RecursionDepthTest {
* @see <a href="https://tests.sequoia-pgp.org/#Maximum_recursion_depth">Sequoia-PGP Test Suite</a> * @see <a href="https://tests.sequoia-pgp.org/#Maximum_recursion_depth">Sequoia-PGP Test Suite</a>
*/ */
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void decryptionAbortsWhenMaximumRecursionDepthReachedTest(ImplementationFactory implementationFactory) throws IOException, PGPException { public void decryptionAbortsWhenMaximumRecursionDepthReachedTest(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
String key = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" + String key = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" +

View file

@ -48,7 +48,7 @@ import org.pgpainless.key.util.KeyRingUtils;
/** /**
* Test functionality of the {@link MissingPublicKeyCallback} which is called when during signature verification, * Test functionality of the {@link MissingPublicKeyCallback} which is called when during signature verification,
* a signature is encountered which was made by a key that was not provided in * a signature is encountered which was made by a key that was not provided in
* {@link DecryptionBuilderInterface.VerifyWith#verifyWith(PGPPublicKeyRing)}. * {@link ConsumerOptions#addVerificationCert(PGPPublicKeyRing)}.
*/ */
public class VerifyWithMissingPublicKeyCallback { public class VerifyWithMissingPublicKeyCallback {

View file

@ -82,7 +82,7 @@ public class EncryptDecryptTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void freshKeysRsaToElGamalTest(ImplementationFactory implementationFactory) public void freshKeysRsaToElGamalTest(ImplementationFactory implementationFactory)
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException { throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -96,7 +96,7 @@ public class EncryptDecryptTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void freshKeysRsaToRsaTest(ImplementationFactory implementationFactory) public void freshKeysRsaToRsaTest(ImplementationFactory implementationFactory)
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException { throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -107,7 +107,7 @@ public class EncryptDecryptTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void freshKeysEcToEcTest(ImplementationFactory implementationFactory) public void freshKeysEcToEcTest(ImplementationFactory implementationFactory)
throws IOException, PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException { throws IOException, PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -118,7 +118,7 @@ public class EncryptDecryptTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void freshKeysEcToRsaTest(ImplementationFactory implementationFactory) public void freshKeysEcToRsaTest(ImplementationFactory implementationFactory)
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException { throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -129,7 +129,7 @@ public class EncryptDecryptTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void freshKeysRsaToEcTest(ImplementationFactory implementationFactory) public void freshKeysRsaToEcTest(ImplementationFactory implementationFactory)
throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException { throws PGPException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -140,7 +140,7 @@ public class EncryptDecryptTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void existingRsaKeysTest(ImplementationFactory implementationFactory) throws IOException, PGPException { public void existingRsaKeysTest(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
PGPSecretKeyRing sender = TestKeys.getJulietSecretKeyRing(); PGPSecretKeyRing sender = TestKeys.getJulietSecretKeyRing();
@ -205,7 +205,7 @@ public class EncryptDecryptTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testDetachedSignatureCreationAndVerification(ImplementationFactory implementationFactory) throws IOException, PGPException { public void testDetachedSignatureCreationAndVerification(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -251,7 +251,7 @@ public class EncryptDecryptTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testOnePassSignatureCreationAndVerification(ImplementationFactory implementationFactory) throws IOException, PGPException { public void testOnePassSignatureCreationAndVerification(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
PGPSecretKeyRing signingKeys = TestKeys.getJulietSecretKeyRing(); PGPSecretKeyRing signingKeys = TestKeys.getJulietSecretKeyRing();

View file

@ -31,7 +31,7 @@ import org.pgpainless.util.Passphrase;
public class EncryptionStreamClosedTest { public class EncryptionStreamClosedTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testStreamHasToBeClosedBeforeGetResultCanBeCalled(ImplementationFactory implementationFactory) throws IOException, PGPException { public void testStreamHasToBeClosedBeforeGetResultCanBeCalled(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
OutputStream out = new ByteArrayOutputStream(); OutputStream out = new ByteArrayOutputStream();

View file

@ -53,7 +53,7 @@ import org.pgpainless.util.Passphrase;
public class SigningTest { public class SigningTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testEncryptionAndSignatureVerification(ImplementationFactory implementationFactory) throws IOException, PGPException { public void testEncryptionAndSignatureVerification(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);

View file

@ -48,7 +48,7 @@ import org.pgpainless.provider.ProviderFactory;
public class BouncycastleExportSubkeys { public class BouncycastleExportSubkeys {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testExportImport(ImplementationFactory implementationFactory) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, PGPException { public void testExportImport(ImplementationFactory implementationFactory) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
KeyPairGenerator generator; KeyPairGenerator generator;

View file

@ -36,7 +36,7 @@ public class ImportExportKeyTest {
* @throws IOException in case of a IO error * @throws IOException in case of a IO error
*/ */
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testExportImportPublicKeyRing(ImplementationFactory implementationFactory) throws IOException { public void testExportImportPublicKeyRing(ImplementationFactory implementationFactory) throws IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
PGPPublicKeyRing publicKeys = TestKeys.getJulietPublicKeyRing(); PGPPublicKeyRing publicKeys = TestKeys.getJulietPublicKeyRing();

View file

@ -47,7 +47,7 @@ import org.pgpainless.util.Passphrase;
public class BrainpoolKeyGenerationTest { public class BrainpoolKeyGenerationTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void generateEcKeysTest(ImplementationFactory implementationFactory) public void generateEcKeysTest(ImplementationFactory implementationFactory)
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException { throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -79,7 +79,7 @@ public class BrainpoolKeyGenerationTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void generateEdDSAKeyTest(ImplementationFactory implementationFactory) public void generateEdDSAKeyTest(ImplementationFactory implementationFactory)
throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException { throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);

View file

@ -34,7 +34,7 @@ public class CertificationKeyMustBeAbleToCertifyTest {
* This test therefore verifies that generating such keys fails. * This test therefore verifies that generating such keys fails.
*/ */
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testCertificationIncapableKeyTypesThrow(ImplementationFactory implementationFactory) { public void testCertificationIncapableKeyTypesThrow(ImplementationFactory implementationFactory) {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
KeyType[] typesIncapableOfCreatingVerifications = new KeyType[] { KeyType[] typesIncapableOfCreatingVerifications = new KeyType[] {

View file

@ -35,7 +35,7 @@ import org.pgpainless.util.ArmorUtils;
public class GenerateEllipticCurveKeyTest { public class GenerateEllipticCurveKeyTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void test(ImplementationFactory implementationFactory) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, IOException { public void test(ImplementationFactory implementationFactory) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
PGPSecretKeyRing keyRing = PGPainless.generateKeyRing() PGPSecretKeyRing keyRing = PGPainless.generateKeyRing()

View file

@ -39,7 +39,7 @@ public class GenerateKeyTest {
private static final Logger LOGGER = Logger.getLogger(GenerateKeyTest.class.getName()); private static final Logger LOGGER = Logger.getLogger(GenerateKeyTest.class.getName());
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void generateKey(ImplementationFactory implementationFactory) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, IOException { public void generateKey(ImplementationFactory implementationFactory) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);

View file

@ -44,7 +44,7 @@ import org.pgpainless.util.ArmoredOutputStreamFactory;
public class GenerateKeyWithAdditionalUserIdTest { public class GenerateKeyWithAdditionalUserIdTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void test(ImplementationFactory implementationFactory) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, IOException { public void test(ImplementationFactory implementationFactory) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
Date now = new Date(); Date now = new Date();

View file

@ -41,7 +41,7 @@ import org.pgpainless.util.Passphrase;
public class GenerateWithEmptyPassphrase { public class GenerateWithEmptyPassphrase {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testGeneratingKeyWithEmptyPassphraseDoesNotThrow(ImplementationFactory implementationFactory) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, IOException { public void testGeneratingKeyWithEmptyPassphraseDoesNotThrow(ImplementationFactory implementationFactory) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);

View file

@ -29,7 +29,7 @@ import org.pgpainless.key.generation.type.xdh.XDHSpec;
public class IllegalKeyFlagsTest { public class IllegalKeyFlagsTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testKeyCannotCarryFlagsTest(ImplementationFactory implementationFactory) { public void testKeyCannotCarryFlagsTest(ImplementationFactory implementationFactory) {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
assertThrows(IllegalArgumentException.class, () -> PGPainless.generateKeyRing() assertThrows(IllegalArgumentException.class, () -> PGPainless.generateKeyRing()

View file

@ -58,7 +58,7 @@ import org.pgpainless.util.Passphrase;
public class KeyRingInfoTest { public class KeyRingInfoTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testWithEmilsKeys(ImplementationFactory implementationFactory) throws IOException, PGPException { public void testWithEmilsKeys(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -165,7 +165,7 @@ public class KeyRingInfoTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void dummyS2KTest(ImplementationFactory implementationFactory) throws PGPException, IOException { public void dummyS2KTest(ImplementationFactory implementationFactory) throws PGPException, IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -204,7 +204,7 @@ public class KeyRingInfoTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testGetKeysWithFlagsAndExpiry(ImplementationFactory implementationFactory) throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException { public void testGetKeysWithFlagsAndExpiry(ImplementationFactory implementationFactory) throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);

View file

@ -49,7 +49,7 @@ import org.pgpainless.util.Passphrase;
public class AddSubKeyTest { public class AddSubKeyTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testAddSubKey(ImplementationFactory implementationFactory) throws IOException, PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException { public void testAddSubKey(ImplementationFactory implementationFactory) throws IOException, PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing(); PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();

View file

@ -40,7 +40,7 @@ import org.pgpainless.util.Passphrase;
public class AddUserIdTest { public class AddUserIdTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void addUserIdToExistingKeyRing(ImplementationFactory implementationFactory) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException { public void addUserIdToExistingKeyRing(ImplementationFactory implementationFactory) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing().simpleEcKeyRing("alice@wonderland.lit", "rabb1th0le"); PGPSecretKeyRing secretKeys = PGPainless.generateKeyRing().simpleEcKeyRing("alice@wonderland.lit", "rabb1th0le");
@ -69,7 +69,7 @@ public class AddUserIdTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void deleteUserId_noSuchElementExceptionForMissingUserId(ImplementationFactory implementationFactory) throws IOException, PGPException { public void deleteUserId_noSuchElementExceptionForMissingUserId(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -79,7 +79,7 @@ public class AddUserIdTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void deleteExistingAndAddNewUserIdToExistingKeyRing(ImplementationFactory implementationFactory) throws PGPException, IOException { public void deleteExistingAndAddNewUserIdToExistingKeyRing(ImplementationFactory implementationFactory) throws PGPException, IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);

View file

@ -39,7 +39,7 @@ public class ChangeExpirationTest {
private final OpenPgpV4Fingerprint subKeyFingerprint = new OpenPgpV4Fingerprint("F73FDE6439ABE210B1AF4EDD273EF7A0C749807B"); private final OpenPgpV4Fingerprint subKeyFingerprint = new OpenPgpV4Fingerprint("F73FDE6439ABE210B1AF4EDD273EF7A0C749807B");
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void setExpirationDateAndThenUnsetIt_OnPrimaryKey(ImplementationFactory implementationFactory) throws PGPException, IOException, InterruptedException { public void setExpirationDateAndThenUnsetIt_OnPrimaryKey(ImplementationFactory implementationFactory) throws PGPException, IOException, InterruptedException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -72,7 +72,7 @@ public class ChangeExpirationTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void setExpirationDateAndThenUnsetIt_OnSubkey(ImplementationFactory implementationFactory) throws PGPException, IOException, InterruptedException { public void setExpirationDateAndThenUnsetIt_OnSubkey(ImplementationFactory implementationFactory) throws PGPException, IOException, InterruptedException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);

View file

@ -56,7 +56,7 @@ public class ChangeSecretKeyRingPassphraseTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void changePassphraseOfWholeKeyRingTest(ImplementationFactory implementationFactory) throws PGPException { public void changePassphraseOfWholeKeyRingTest(ImplementationFactory implementationFactory) throws PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -84,7 +84,7 @@ public class ChangeSecretKeyRingPassphraseTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void changePassphraseOfWholeKeyRingToEmptyPassphrase(ImplementationFactory implementationFactory) throws PGPException, IOException { public void changePassphraseOfWholeKeyRingToEmptyPassphrase(ImplementationFactory implementationFactory) throws PGPException, IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
PGPSecretKeyRing secretKeys = PGPainless.modifyKeyRing(keyRing) PGPSecretKeyRing secretKeys = PGPainless.modifyKeyRing(keyRing)
@ -102,7 +102,7 @@ public class ChangeSecretKeyRingPassphraseTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void changePassphraseOfSingleSubkeyToNewPassphrase(ImplementationFactory implementationFactory) throws PGPException { public void changePassphraseOfSingleSubkeyToNewPassphrase(ImplementationFactory implementationFactory) throws PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -139,7 +139,7 @@ public class ChangeSecretKeyRingPassphraseTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void changePassphraseOfSingleSubkeyToEmptyPassphrase(ImplementationFactory implementationFactory) throws PGPException { public void changePassphraseOfSingleSubkeyToEmptyPassphrase(ImplementationFactory implementationFactory) throws PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);

View file

@ -38,7 +38,7 @@ import org.pgpainless.key.protection.UnprotectedKeysProtector;
public class OldSignatureSubpacketsArePreservedOnNewSig { public class OldSignatureSubpacketsArePreservedOnNewSig {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void verifyOldSignatureSubpacketsArePreservedOnNewExpirationDateSig(ImplementationFactory implementationFactory) public void verifyOldSignatureSubpacketsArePreservedOnNewExpirationDateSig(ImplementationFactory implementationFactory)
throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, InterruptedException, IOException { throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, PGPException, InterruptedException, IOException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);

View file

@ -75,7 +75,7 @@ public class RevokeKeyWithGenericCertificationSignatureTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void test(ImplementationFactory implementationFactory) throws IOException, PGPException { public void test(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
revokeKey(SAMPLE_PRIVATE_KEY); // would crash previously revokeKey(SAMPLE_PRIVATE_KEY); // would crash previously

View file

@ -112,7 +112,7 @@ public class RevokeKeyWithoutPreferredAlgorithmsOnPrimaryKey {
"-----END PGP PRIVATE KEY BLOCK-----"; "-----END PGP PRIVATE KEY BLOCK-----";
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testChangingExpirationTimeWithKeyWithoutPrefAlgos(ImplementationFactory implementationFactory) throws IOException, PGPException { public void testChangingExpirationTimeWithKeyWithoutPrefAlgos(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
Date expirationDate = new Date(); Date expirationDate = new Date();

View file

@ -46,7 +46,7 @@ import org.pgpainless.util.Passphrase;
public class RevokeSubKeyTest { public class RevokeSubKeyTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void revokeSukeyTest(ImplementationFactory implementationFactory) throws IOException, PGPException { public void revokeSukeyTest(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing(); PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
@ -71,7 +71,7 @@ public class RevokeSubKeyTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void detachedRevokeSubkeyTest(ImplementationFactory implementationFactory) throws IOException, PGPException { public void detachedRevokeSubkeyTest(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing(); PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();
@ -97,7 +97,7 @@ public class RevokeSubKeyTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testRevocationSignatureTypeCorrect(ImplementationFactory implementationFactory) throws IOException, PGPException { public void testRevocationSignatureTypeCorrect(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing(); PGPSecretKeyRing secretKeys = TestKeys.getCryptieSecretKeyRing();

View file

@ -46,7 +46,7 @@ import org.pgpainless.util.Passphrase;
public class SecretKeyRingProtectorTest { public class SecretKeyRingProtectorTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testUnlockAllKeysWithSamePassword(ImplementationFactory implementationFactory) throws IOException, PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException { public void testUnlockAllKeysWithSamePassword(ImplementationFactory implementationFactory) throws IOException, PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
@ -78,7 +78,7 @@ public class SecretKeyRingProtectorTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testUnlockSingleKeyWithPassphrase(ImplementationFactory implementationFactory) throws IOException, PGPException { public void testUnlockSingleKeyWithPassphrase(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);

View file

@ -37,7 +37,7 @@ import org.pgpainless.util.Passphrase;
public class MultiPassphraseSymmetricEncryptionTest { public class MultiPassphraseSymmetricEncryptionTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
@Disabled @Disabled
public void encryptDecryptWithMultiplePassphrases(ImplementationFactory implementationFactory) throws IOException, PGPException { public void encryptDecryptWithMultiplePassphrases(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);

View file

@ -51,7 +51,7 @@ import org.pgpainless.util.Passphrase;
public class SymmetricEncryptionTest { public class SymmetricEncryptionTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void encryptWithKeyAndPassphrase_DecryptWithKey(ImplementationFactory implementationFactory) throws IOException, PGPException { public void encryptWithKeyAndPassphrase_DecryptWithKey(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);
byte[] plaintext = "This is a secret message".getBytes(StandardCharsets.UTF_8); byte[] plaintext = "This is a secret message".getBytes(StandardCharsets.UTF_8);
@ -105,7 +105,7 @@ public class SymmetricEncryptionTest {
} }
@ParameterizedTest @ParameterizedTest
@MethodSource("org.pgpainless.util.TestUtil#provideImplementationFactories") @MethodSource("org.pgpainless.util.TestImplementationFactoryProvider#provideImplementationFactories")
public void testMismatchPassphraseFails(ImplementationFactory implementationFactory) throws IOException, PGPException { public void testMismatchPassphraseFails(ImplementationFactory implementationFactory) throws IOException, PGPException {
ImplementationFactory.setFactoryImplementation(implementationFactory); ImplementationFactory.setFactoryImplementation(implementationFactory);

View file

@ -25,7 +25,7 @@ import java.util.List;
/** /**
* Utility class used to provide all available implementations of {@link ImplementationFactory} for parametrized tests. * Utility class used to provide all available implementations of {@link ImplementationFactory} for parametrized tests.
*/ */
public class TestUtil { public class TestImplementationFactoryProvider {
private static final List<ImplementationFactory> IMPLEMENTATIONS = Arrays.asList( private static final List<ImplementationFactory> IMPLEMENTATIONS = Arrays.asList(
new BcImplementationFactory(), new BcImplementationFactory(),