From f966c1ed073a0e378f84083546d5971f83f748b6 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 20 Jul 2022 18:07:42 +0200 Subject: [PATCH] Explicitly cast Long to long to fix ambiguity in debian tests --- .../decryption_verification/MessageInspectorTest.java | 2 +- .../VerifyWithMissingPublicKeyCallback.java | 2 +- .../key/protection/CachingSecretKeyRingProtectorTest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/MessageInspectorTest.java b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/MessageInspectorTest.java index dd47ec4b..b7382360 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/MessageInspectorTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/MessageInspectorTest.java @@ -33,7 +33,7 @@ public class MessageInspectorTest { assertFalse(info.isSignedOnly()); assertTrue(info.isEncrypted()); assertEquals(1, info.getKeyIds().size()); - assertEquals(KeyIdUtil.fromLongKeyId("4766F6B9D5F21EB6"), info.getKeyIds().get(0)); + assertEquals(KeyIdUtil.fromLongKeyId("4766F6B9D5F21EB6"), (long) info.getKeyIds().get(0)); } @Test diff --git a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/VerifyWithMissingPublicKeyCallback.java b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/VerifyWithMissingPublicKeyCallback.java index e4e9427b..bcbad822 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/VerifyWithMissingPublicKeyCallback.java +++ b/pgpainless-core/src/test/java/org/pgpainless/decryption_verification/VerifyWithMissingPublicKeyCallback.java @@ -66,7 +66,7 @@ public class VerifyWithMissingPublicKeyCallback { @Nullable @Override public PGPPublicKeyRing onMissingPublicKeyEncountered(@Nonnull Long keyId) { - assertEquals(signingKey.getKeyID(), keyId, "Signing key-ID mismatch."); + assertEquals(signingKey.getKeyID(), (long) keyId, "Signing key-ID mismatch."); return signingPubKeys; } })); diff --git a/pgpainless-core/src/test/java/org/pgpainless/key/protection/CachingSecretKeyRingProtectorTest.java b/pgpainless-core/src/test/java/org/pgpainless/key/protection/CachingSecretKeyRingProtectorTest.java index 6c103ea3..d1f5f9e6 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/key/protection/CachingSecretKeyRingProtectorTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/key/protection/CachingSecretKeyRingProtectorTest.java @@ -129,7 +129,7 @@ public class CachingSecretKeyRingProtectorTest { Passphrase passphrase = withCallback.getPassphraseFor(x); assertNotNull(passphrase); - assertEquals(doubled, Long.valueOf(new String(passphrase.getChars()))); + assertEquals(doubled, (long) Long.valueOf(new String(passphrase.getChars()))); } }