1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 15:52:06 +01:00

[ox-im] Annotate sporadically failing assertTrue()

This commit is contained in:
Florian Schmaus 2021-07-16 08:56:14 +02:00
parent f64288ba6d
commit a057db107e

View file

@ -50,6 +50,7 @@ import org.jivesoftware.smackx.ox.exception.MissingUserIdOnKeyException;
import org.jivesoftware.smackx.ox.store.filebased.FileBasedOpenPgpStore; import org.jivesoftware.smackx.ox.store.filebased.FileBasedOpenPgpStore;
import org.bouncycastle.openpgp.PGPException; import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -156,9 +157,13 @@ public class OXInstantMessagingManagerTest extends SmackTestSuite {
// Check, if one of Bobs keys was used for decryption // Check, if one of Bobs keys was used for decryption
assertNotNull(bobSelf.getSigningKeyRing().getPublicKey(metadata.getDecryptionFingerprint().getKeyId())); assertNotNull(bobSelf.getSigningKeyRing().getPublicKey(metadata.getDecryptionFingerprint().getKeyId()));
// TODO: I observed this assertTrue() to fail sporadically. As a first attempt to diagnose this, a message was
// added to the assertion. However since most (all?) objects used in the message do not implement a proper
// toString() this is probably not really helpful as it is.
PGPPublicKeyRingCollection pubKeys = aliceForBob.getTrustedAnnouncedKeys();
// Check if one of Alice' keys was used for signing // Check if one of Alice' keys was used for signing
assertTrue(metadata.containsVerifiedSignatureFrom( assertTrue(metadata.containsVerifiedSignatureFrom(
aliceForBob.getTrustedAnnouncedKeys().iterator().next())); pubKeys.iterator().next()), metadata + " did not contain one of alice' keys " + pubKeys);
} }
@AfterClass @AfterClass