com.atlassian.confluence.it.mail
Class MailAssertions
java.lang.Object
com.atlassian.confluence.it.mail.MailAssertions
public class MailAssertions
- extends java.lang.Object
Assertions on Mail messages.
- Since:
- v4.2
Method Summary |
static void |
assertBodyDoesNotContainPageTitle(javax.mail.internet.MimeMessage message,
Page page)
|
static void |
assertCorrectMessageRecipients(MailFacade mailFacade,
User user)
|
static void |
assertFirstRecipient(javax.mail.internet.MimeMessage message,
User user)
|
static void |
assertHasMail(java.util.List<javax.mail.internet.MimeMessage> originalMessages,
User user,
java.lang.String... htmlExcerpts)
Assert at least one email among those received by user matches all the excerpts. |
static void |
assertHasNoPartWithHeader(javax.mail.internet.MimeMessage message,
java.lang.String headerName,
java.lang.String forbidden)
|
static void |
assertHasPartWithHeader(javax.mail.internet.MimeMessage message,
java.lang.String headerName,
java.lang.String expected)
|
static void |
assertMailNotSent(MailFacade mailFacade)
|
static void |
assertMailReceived(MailFacade mailFacade)
|
static void |
assertMailReceived(MailFacade mailFacade,
int expectedMessageCount)
|
static void |
assertStandardHeaders(javax.mail.internet.MimeMessage message,
User user,
AbstractPageEntity page)
|
static void |
assertStandardNotificationHeaders(javax.mail.internet.MimeMessage smtpMessage,
java.lang.String toAddress,
java.lang.String subject)
|
static void |
assertStandardNotificationHeaders(javax.mail.internet.MimeMessage smtpMessage,
java.lang.String toAddress,
java.lang.String spaceTitle,
java.lang.String pageTitle)
|
static java.util.List<java.lang.String> |
getMailForUser(java.util.List<javax.mail.internet.MimeMessage> messages,
User user)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MailAssertions
public MailAssertions()
assertFirstRecipient
public static void assertFirstRecipient(javax.mail.internet.MimeMessage message,
User user)
assertBodyDoesNotContainPageTitle
public static void assertBodyDoesNotContainPageTitle(javax.mail.internet.MimeMessage message,
Page page)
assertStandardNotificationHeaders
public static void assertStandardNotificationHeaders(javax.mail.internet.MimeMessage smtpMessage,
java.lang.String toAddress,
java.lang.String spaceTitle,
java.lang.String pageTitle)
throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
assertStandardHeaders
public static void assertStandardHeaders(javax.mail.internet.MimeMessage message,
User user,
AbstractPageEntity page)
throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
assertStandardNotificationHeaders
public static void assertStandardNotificationHeaders(javax.mail.internet.MimeMessage smtpMessage,
java.lang.String toAddress,
java.lang.String subject)
throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
getMailForUser
public static java.util.List<java.lang.String> getMailForUser(java.util.List<javax.mail.internet.MimeMessage> messages,
User user)
throws java.lang.Exception
- Throws:
java.lang.Exception
assertHasMail
public static void assertHasMail(java.util.List<javax.mail.internet.MimeMessage> originalMessages,
User user,
java.lang.String... htmlExcerpts)
throws java.lang.Exception
- Assert at least one email among those received by user matches all the excerpts.
- Parameters:
originalMessages
- messages from the mail facadeuser
- the recipienthtmlExcerpts
- the excerpt that the message must contain
- Throws:
java.lang.Exception
- in case of error when fetching mail
assertCorrectMessageRecipients
public static void assertCorrectMessageRecipients(MailFacade mailFacade,
User user)
throws java.lang.Exception
- Throws:
java.lang.Exception
assertMailReceived
public static void assertMailReceived(MailFacade mailFacade,
int expectedMessageCount)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
assertMailReceived
public static void assertMailReceived(MailFacade mailFacade)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
assertMailNotSent
public static void assertMailNotSent(MailFacade mailFacade)
throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
assertHasPartWithHeader
public static void assertHasPartWithHeader(javax.mail.internet.MimeMessage message,
java.lang.String headerName,
java.lang.String expected)
throws java.io.IOException,
javax.mail.MessagingException
- Throws:
java.io.IOException
javax.mail.MessagingException
assertHasNoPartWithHeader
public static void assertHasNoPartWithHeader(javax.mail.internet.MimeMessage message,
java.lang.String headerName,
java.lang.String forbidden)
throws java.io.IOException,
javax.mail.MessagingException
- Throws:
java.io.IOException
javax.mail.MessagingException
Copyright © 2003-2013 Atlassian. All Rights Reserved.