Package com.atlassian.bamboo.testutils
Class GreenMailUtils
java.lang.Object
com.atlassian.bamboo.testutils.GreenMailUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
cleanInbox
(@NotNull com.icegreen.greenmail.base.GreenMailOperations greenMail, @NotNull List<String> users) static String
getMessageContent
(@NotNull javax.mail.BodyPart msg) Extract email message from aBodyPart
instance.static String
getMessageContent
(javax.mail.internet.MimeMessage message) Extract email message from aMimeMessage
message.static @NotNull String
static int
static int
nextFreePort
(int startingPort) static @NotNull com.icegreen.greenmail.util.GreenMail
setUpGreenMail
(@NotNull String email, @NotNull String login, @NotNull String password) Deprecated.This should be used only in non-JUnit tests.static com.icegreen.greenmail.util.ServerSetup
static void
tearDownGreenMail
(@Nullable com.icegreen.greenmail.base.GreenMailOperations greenMail) Deprecated.This should be used only in non-JUnit tests.static @NotNull List<javax.mail.internet.MimeMessage>
waitForIncomingEmail
(@NotNull com.icegreen.greenmail.base.GreenMailOperations greenMail, Duration maxWaitTime, int expectedEmailCount) static @NotNull List<javax.mail.internet.MimeMessage>
waitForIncomingEmail
(@NotNull com.icegreen.greenmail.base.GreenMailOperations greenMail, Duration maxWaitTime, org.hamcrest.Matcher<String> matcher) static void
waitForNoEmail
(@NotNull com.icegreen.greenmail.base.GreenMailOperations greenMail, Duration maxWaitTime)
-
Constructor Details
-
GreenMailUtils
public GreenMailUtils()
-
-
Method Details
-
smtpServerSetup
public static com.icegreen.greenmail.util.ServerSetup smtpServerSetup() -
setUpGreenMail
@Deprecated @NotNull public static @NotNull com.icegreen.greenmail.util.GreenMail setUpGreenMail(@NotNull @NotNull String email, @NotNull @NotNull String login, @NotNull @NotNull String password) Deprecated.This should be used only in non-JUnit tests. For JUnit tests useGreenMailRule
-
tearDownGreenMail
@Deprecated public static void tearDownGreenMail(@Nullable @Nullable com.icegreen.greenmail.base.GreenMailOperations greenMail) Deprecated.This should be used only in non-JUnit tests. For JUnit tests useGreenMailRule
-
nextFreePort
public static int nextFreePort() -
nextFreePort
public static int nextFreePort(int startingPort) -
localLoopbackAddress
-
waitForNoEmail
public static void waitForNoEmail(@NotNull @NotNull com.icegreen.greenmail.base.GreenMailOperations greenMail, Duration maxWaitTime) -
waitForIncomingEmail
-
waitForIncomingEmail
@NotNull public static @NotNull List<javax.mail.internet.MimeMessage> waitForIncomingEmail(@NotNull @NotNull com.icegreen.greenmail.base.GreenMailOperations greenMail, Duration maxWaitTime, int expectedEmailCount) throws Exception - Throws:
Exception
-
cleanInbox
-
getMessageContent
public static String getMessageContent(@NotNull @NotNull javax.mail.BodyPart msg) throws IOException, javax.mail.MessagingException Extract email message from aBodyPart
instance.- Throws:
IOException
javax.mail.MessagingException
-
getMessageContent
public static String getMessageContent(javax.mail.internet.MimeMessage message) throws IOException, javax.mail.MessagingException Extract email message from aMimeMessage
message.- Throws:
IOException
javax.mail.MessagingException
-