use of com.fsck.k9.mailstore.MessageCryptoAnnotations in project k-9 by k9mail.
the class MessageCryptoHelperTest method assertPartAnnotationHasState.
private void assertPartAnnotationHasState(Message message, MessageCryptoCallback messageCryptoCallback, CryptoError cryptoErrorState, MimeBodyPart replacementPart, OpenPgpDecryptionResult openPgpDecryptionResult, OpenPgpSignatureResult openPgpSignatureResult, PendingIntent openPgpPendingIntent) {
ArgumentCaptor<MessageCryptoAnnotations> captor = ArgumentCaptor.forClass(MessageCryptoAnnotations.class);
verify(messageCryptoCallback).onCryptoOperationsFinished(captor.capture());
MessageCryptoAnnotations annotations = captor.getValue();
CryptoResultAnnotation cryptoResultAnnotation = annotations.get(message);
assertEquals(cryptoErrorState, cryptoResultAnnotation.getErrorType());
if (replacementPart != null) {
assertSame(replacementPart, cryptoResultAnnotation.getReplacementData());
}
assertSame(openPgpDecryptionResult, cryptoResultAnnotation.getOpenPgpDecryptionResult());
assertSame(openPgpSignatureResult, cryptoResultAnnotation.getOpenPgpSignatureResult());
assertSame(openPgpPendingIntent, cryptoResultAnnotation.getOpenPgpPendingIntent());
verifyNoMoreInteractions(messageCryptoCallback);
}
Aggregations