Package com.atlassian.confluence.it.mail
Class MailAssertions
- java.lang.Object
-
- com.atlassian.confluence.it.mail.MailAssertions
-
public class MailAssertions extends Object
Assertions on Mail messages.- Since:
- 4.2
-
-
Constructor Summary
Constructors Constructor Description MailAssertions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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(List<javax.mail.internet.MimeMessage> originalMessages, User user, String... htmlExcerpts)
Assert at least one email among those received by user matches all the excerpts.static void
assertHasNoPartWithHeader(javax.mail.internet.MimeMessage message, String headerName, String forbidden)
static void
assertHasPartWithHeader(javax.mail.internet.MimeMessage message, String headerName, 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, String toAddress, String subject)
static void
assertStandardNotificationHeaders(javax.mail.internet.MimeMessage smtpMessage, String toAddress, String spaceTitle, String pageTitle)
static List<String>
getMailForUser(List<javax.mail.internet.MimeMessage> messages, User user)
-
-
-
Method Detail
-
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, String toAddress, String spaceTitle, 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, String toAddress, String subject) throws javax.mail.MessagingException
- Throws:
javax.mail.MessagingException
-
getMailForUser
public static List<String> getMailForUser(List<javax.mail.internet.MimeMessage> messages, User user) throws Exception
- Throws:
Exception
-
assertHasMail
public static void assertHasMail(List<javax.mail.internet.MimeMessage> originalMessages, User user, String... htmlExcerpts) throws 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:
Exception
- in case of error when fetching mail
-
assertCorrectMessageRecipients
public static void assertCorrectMessageRecipients(MailFacade mailFacade, User user) throws Exception
- Throws:
Exception
-
assertMailReceived
public static void assertMailReceived(MailFacade mailFacade, int expectedMessageCount) throws InterruptedException
- Throws:
InterruptedException
-
assertMailReceived
public static void assertMailReceived(MailFacade mailFacade) throws InterruptedException
- Throws:
InterruptedException
-
assertMailNotSent
public static void assertMailNotSent(MailFacade mailFacade) throws InterruptedException
- Throws:
InterruptedException
-
assertHasPartWithHeader
public static void assertHasPartWithHeader(javax.mail.internet.MimeMessage message, String headerName, String expected) throws IOException, javax.mail.MessagingException
- Throws:
IOException
javax.mail.MessagingException
-
assertHasNoPartWithHeader
public static void assertHasNoPartWithHeader(javax.mail.internet.MimeMessage message, String headerName, String forbidden) throws IOException, javax.mail.MessagingException
- Throws:
IOException
javax.mail.MessagingException
-
-