public class MailFacade extends Object
Modifier and Type | Field and Description |
---|---|
static String |
TEST_POP_SERVER_NAME |
static String |
TESTMAILSERVER_HOSTNAME |
Constructor and Description |
---|
MailFacade(ConfluenceRpc rpc) |
Modifier and Type | Method and Description |
---|---|
void |
addMailboxesForUsers(User... users) |
void |
addMailboxForUser(MailUser user) |
void |
addMailboxForUser(User user) |
void |
addPopMailServer(String username,
String password,
String toAddress) |
void |
changeSmtpFromName(String fromName) |
void |
changeSmtpServerHost(String hostname,
int port) |
List<javax.mail.internet.MimeMessage> |
getMessages()
Returns whatever messages are available
|
int |
getPopPort() |
javax.mail.internet.MimeMessage |
getReceivedMessage() |
boolean |
noMessages() |
void |
removeAllRecievedMessages() |
void |
removeMailServer() |
void |
removeMailServer(String serverName) |
void |
removePopMailServer() |
void |
reset() |
void |
send(String to,
String from,
String subject,
String body) |
void |
sendMimeMessage(InputStream inputStream) |
MailFacade |
start()
Starts up and configures a new mail server which will be pulled back down during test tearDown.
|
void |
startMailServerOnly(User... additionalUsers)
Starts the mail server, but DOESN'T configure Confluence to use it.
|
MailFacade |
startSoleServer()
Same as
start() except it removes all existing mail servers if any are configured. |
void |
stop() |
boolean |
verifyNoMessages() |
javax.mail.internet.MimeMessage |
waitForFirstMessage() |
javax.mail.internet.MimeMessage |
waitForMessage()
Waits for at least one message and returns it
|
List<javax.mail.internet.MimeMessage> |
waitForMessages(Integer expectedCount) |
List<javax.mail.internet.MimeMessage> |
waitForMessages(org.hamcrest.Matcher<Integer> matcher) |
void |
watchAsHtmlWithDiffs(User user) |
public static final String TESTMAILSERVER_HOSTNAME
public static final String TEST_POP_SERVER_NAME
public MailFacade(ConfluenceRpc rpc)
public MailFacade startSoleServer() throws Exception
start()
except it removes all existing mail servers if any are configured. It is your
responsibility to ensure that stop()
is eventually called once you call this method.BindException
- If a free port could not be foundException
public MailFacade start() throws Exception
stop()
is eventually called once you call this method.BindException
- If a free port could not be foundException
public void startMailServerOnly(User... additionalUsers) throws Exception
Exception
public void addMailboxesForUsers(User... users)
public void addMailboxForUser(User user)
public void addMailboxForUser(MailUser user)
public javax.mail.internet.MimeMessage getReceivedMessage() throws Exception
Exception
public boolean verifyNoMessages()
public List<javax.mail.internet.MimeMessage> waitForMessages(org.hamcrest.Matcher<Integer> matcher)
public List<javax.mail.internet.MimeMessage> getMessages()
public javax.mail.internet.MimeMessage waitForFirstMessage()
public boolean noMessages()
public void stop()
public void removeMailServer(String serverName)
public void removeMailServer()
public void changeSmtpServerHost(String hostname, int port)
public void changeSmtpFromName(String fromName)
public void reset() throws com.icegreen.greenmail.store.FolderException
com.icegreen.greenmail.store.FolderException
public void removeAllRecievedMessages() throws com.icegreen.greenmail.store.FolderException
com.icegreen.greenmail.store.FolderException
public void sendMimeMessage(InputStream inputStream)
public int getPopPort()
public javax.mail.internet.MimeMessage waitForMessage()
public void watchAsHtmlWithDiffs(User user)
public void removePopMailServer()
Copyright © 2003–2021 Atlassian. All rights reserved.