public class MailAssertions extends Object
Constructor and Description |
---|
MailAssertions() |
Modifier and Type | Method and 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) |
public static void assertFirstRecipient(javax.mail.internet.MimeMessage message, User user)
public static void assertBodyDoesNotContainPageTitle(javax.mail.internet.MimeMessage message, Page page)
public static void assertStandardNotificationHeaders(javax.mail.internet.MimeMessage smtpMessage, String toAddress, String spaceTitle, String pageTitle) throws javax.mail.MessagingException
javax.mail.MessagingException
public static void assertStandardHeaders(javax.mail.internet.MimeMessage message, User user, AbstractPageEntity page) throws javax.mail.MessagingException
javax.mail.MessagingException
public static void assertStandardNotificationHeaders(javax.mail.internet.MimeMessage smtpMessage, String toAddress, String subject) throws javax.mail.MessagingException
javax.mail.MessagingException
public static List<String> getMailForUser(List<javax.mail.internet.MimeMessage> messages, User user) throws Exception
Exception
public static void assertHasMail(List<javax.mail.internet.MimeMessage> originalMessages, User user, String... htmlExcerpts) throws Exception
originalMessages
- messages from the mail facadeuser
- the recipienthtmlExcerpts
- the excerpt that the message must containException
- in case of error when fetching mailpublic static void assertCorrectMessageRecipients(MailFacade mailFacade, User user) throws Exception
Exception
public static void assertMailReceived(MailFacade mailFacade, int expectedMessageCount) throws InterruptedException
InterruptedException
public static void assertMailReceived(MailFacade mailFacade) throws InterruptedException
InterruptedException
public static void assertMailNotSent(MailFacade mailFacade) throws InterruptedException
InterruptedException
public static void assertHasPartWithHeader(javax.mail.internet.MimeMessage message, String headerName, String expected) throws IOException, javax.mail.MessagingException
IOException
javax.mail.MessagingException
public static void assertHasNoPartWithHeader(javax.mail.internet.MimeMessage message, String headerName, String forbidden) throws IOException, javax.mail.MessagingException
IOException
javax.mail.MessagingException
Copyright © 2003–2018 Atlassian. All rights reserved.