com.atlassian.confluence.it.mail
Class MailAssertions

java.lang.Object
  extended by com.atlassian.confluence.it.mail.MailAssertions

public class MailAssertions
extends Object

Assertions on Mail messages.

Since:
v4.2

Constructor Summary
MailAssertions()
           
 
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(MailFacade mailFacade, 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 count)
           
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(MailFacade mailFacade, User user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailAssertions

public MailAssertions()
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(MailFacade mailFacade,
                                          User user)
                                   throws Exception
Throws:
Exception

assertHasMail

public static void assertHasMail(MailFacade mailFacade,
                                 User user,
                                 String... htmlExcerpts)
                          throws Exception
Assert at least one email among those received by user matches all the excerpts.

Parameters:
mailFacade - the mail facade
user - the recipient
htmlExcerpts - 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 count)
                               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


Copyright © 2003-2013 Atlassian. All Rights Reserved.