Package com.atlassian.bamboo.testutils
Class GreenMailUtils
- java.lang.Object
-
- com.atlassian.bamboo.testutils.GreenMailUtils
-
public class GreenMailUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description GreenMailUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidcleanInbox(@NotNull com.icegreen.greenmail.base.GreenMailOperations greenMail, @NotNull List<String> users)static StringgetMessageContent(@NotNull javax.mail.BodyPart msg)Extract email message from aBodyPartinstance.static StringgetMessageContent(javax.mail.internet.MimeMessage message)Extract email message from aMimeMessagemessage.static @NotNull StringlocalLoopbackAddress()static intnextFreePort()static intnextFreePort(int startingPort)static @NotNull com.icegreen.greenmail.util.GreenMailsetUpGreenMail(@NotNull String email, @NotNull String login, @NotNull String password)Deprecated.This should be used only in non-JUnit tests.static com.icegreen.greenmail.util.ServerSetupsmtpServerSetup()static voidtearDownGreenMail(@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 voidwaitForNoEmail(@NotNull com.icegreen.greenmail.base.GreenMailOperations greenMail, Duration maxWaitTime)
-
-
-
Method Detail
-
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
@NotNull public static @NotNull String localLoopbackAddress()
-
waitForNoEmail
public static void waitForNoEmail(@NotNull @NotNull com.icegreen.greenmail.base.GreenMailOperations greenMail, Duration maxWaitTime)
-
waitForIncomingEmail
@NotNull public static @NotNull List<javax.mail.internet.MimeMessage> waitForIncomingEmail(@NotNull @NotNull com.icegreen.greenmail.base.GreenMailOperations greenMail, Duration maxWaitTime, org.hamcrest.Matcher<String> matcher)
-
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
public static void cleanInbox(@NotNull @NotNull com.icegreen.greenmail.base.GreenMailOperations greenMail, @NotNull @NotNull List<String> users)
-
getMessageContent
public static String getMessageContent(@NotNull @NotNull javax.mail.BodyPart msg) throws IOException, javax.mail.MessagingException
Extract email message from aBodyPartinstance.- Throws:
IOExceptionjavax.mail.MessagingException
-
getMessageContent
public static String getMessageContent(javax.mail.internet.MimeMessage message) throws IOException, javax.mail.MessagingException
Extract email message from aMimeMessagemessage.- Throws:
IOExceptionjavax.mail.MessagingException
-
-