mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 10:37:59 +01:00
[ox-im] Annotate sporadically failing assertTrue()
This commit is contained in:
parent
f64288ba6d
commit
a057db107e
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue