public class GreenMailRule extends GreenMailProxy implements MethodRule, TestRule
The rule ensures that each test method starts with a clean GreenMail instance without relics from previous tests of current suite.
Note: Contains extracted GreenMail Junit4 rule from previous and deprecated com.icegreen.greenmail.junit.GreenMailRule of the greenmail-core module.
| Constructor and Description |
|---|
GreenMailRule() |
GreenMailRule(ServerSetup serverSetup)
Initialize with single server setups
|
GreenMailRule(ServerSetup[] serverSetups)
Initialize with multiple server setups
|
| Modifier and Type | Method and Description |
|---|---|
Statement |
apply(Statement base,
Description description) |
Statement |
apply(Statement base,
FrameworkMethod method,
Object target) |
protected GreenMail |
getGreenMail() |
boolean |
isRunning() |
GreenMailRule |
withConfiguration(GreenMailConfiguration config) |
getImap, getImaps, getManagers, getPop3, getPop3s, getReceivedMessages, getReceivedMessagesForDomain, getSmtp, getSmtps, getUserManager, purgeEmailFromAllMailboxes, reset, setQuotaSupported, setUser, setUser, setUsers, start, stop, waitForIncomingEmail, waitForIncomingEmaildoConfigurepublic GreenMailRule(ServerSetup[] serverSetups)
serverSetups - All setups to usepublic GreenMailRule(ServerSetup serverSetup)
serverSetup - Setup to usepublic GreenMailRule()
public Statement apply(Statement base, Description description)
public Statement apply(Statement base, FrameworkMethod method, Object target)
apply in interface MethodRulepublic GreenMailRule withConfiguration(GreenMailConfiguration config)
withConfiguration in interface GreenMailOperationswithConfiguration in class ConfiguredGreenMailpublic boolean isRunning()
isRunning in interface GreenMailOperationsprotected GreenMail getGreenMail()
getGreenMail in class GreenMailProxyCopyright © 2006–2023 Icegreen Technologies. All rights reserved.