Class ConfiguredGreenMail
java.lang.Object
com.icegreen.greenmail.configuration.ConfiguredGreenMail
- All Implemented Interfaces:
GreenMailOperations
- Direct Known Subclasses:
GreenMail, GreenMailProxy
A version of GreenMailOperations that implements the configure() method.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidThis method can be used by child classes to apply the configuration that is stored in config.Configure GreenMail instance using the given configurationMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GreenMailOperations
findReceivedMessages, getImap, getImaps, getManagers, getPop3, getPop3s, getReceivedMessages, getReceivedMessagesForDomain, getSmtp, getSmtps, getUserManager, isRunning, loadEmails, purgeEmailFromAllMailboxes, reset, setQuotaSupported, setUser, setUser, setUsers, start, stop, waitForIncomingEmail, waitForIncomingEmailModifier and TypeMethodDescriptionfindReceivedMessages(Predicate<GreenMailUser> userPredicate, Predicate<MimeMessage> messagePredicate) Finds all messages matching the user account and message predicate.getImap()getImaps()getPop3()getPop3s()getReceivedMessagesForDomain(String domain) Gets all messages containing given domain.getSmtp()getSmtps()booleanChecks if GreenMail is up and running.loadEmails(Path path) Loads emails from given path.voidRemove/purge all data from all mail stores (POP3/IMAP)voidreset()Restart the GreenMail server.voidsetQuotaSupported(boolean isEnabled) Toggles the IMAP quota support.Sets the password for the account linked to email.Sets the password for the account linked to email.voidsetUsers(Properties users) Sets up accounts with password based on a properties map where the key is the email/login and the value the passwordvoidstart()Start the GreenMail servervoidstop()Stop the GreenMail server.booleanwaitForIncomingEmail(int emailCount) Does the same thing asGreenMailOperations.waitForIncomingEmail(long, int)but with a default timeout of 5000msbooleanwaitForIncomingEmail(long timeout, int emailCount) Use this method if you are sending email in a different thread from the one you're testing from.
-
Constructor Details
-
ConfiguredGreenMail
public ConfiguredGreenMail()
-
-
Method Details
-
withConfiguration
Description copied from interface:GreenMailOperationsConfigure GreenMail instance using the given configuration- Specified by:
withConfigurationin interfaceGreenMailOperations- Parameters:
config- Configuration to use- Returns:
- self (for method chaining)
-
doConfigure
protected void doConfigure()This method can be used by child classes to apply the configuration that is stored in config.
-