public class GreenMailExtension extends GreenMailProxy implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback
@RegisterExtension Junit5 mechanism and made variable static.static keyword annotate test class with @TestInstance(TestInstance.Lifecycle.PER_CLASS).RegisterExtension,
TestInstance| Constructor and Description |
|---|
GreenMailExtension()
Initialize with all server setups.
|
GreenMailExtension(ServerSetup serverSetup)
Initialize with single server setups.
|
GreenMailExtension(ServerSetup[] serverSetups)
Initialize with multiple server setups.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterAll(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
afterEach(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
beforeAll(org.junit.jupiter.api.extension.ExtensionContext context) |
void |
beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) |
protected GreenMail |
getGreenMail() |
GreenMailExtension |
withConfiguration(GreenMailConfiguration config) |
GreenMailExtension |
withPerMethodLifecycle(boolean perMethod)
Specify whether GreenMail should be set up and torn down before and after
each method or before and after all methods.
|
getImap, getImaps, getManagers, getPop3, getPop3s, getReceivedMessages, getReceivedMessagesForDomain, getSmtp, getSmtps, purgeEmailFromAllMailboxes, reset, setQuotaSupported, setUser, setUser, setUsers, start, stop, waitForIncomingEmail, waitForIncomingEmaildoConfigurepublic GreenMailExtension(ServerSetup serverSetup)
serverSetup - Setup to usepublic GreenMailExtension()
public GreenMailExtension(ServerSetup[] serverSetups)
serverSetups - All setups to usepublic void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
beforeEach in interface org.junit.jupiter.api.extension.BeforeEachCallbackpublic void afterEach(org.junit.jupiter.api.extension.ExtensionContext context)
afterEach in interface org.junit.jupiter.api.extension.AfterEachCallbackpublic void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
beforeAll in interface org.junit.jupiter.api.extension.BeforeAllCallbackExceptionpublic void afterAll(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
afterAll in interface org.junit.jupiter.api.extension.AfterAllCallbackExceptionpublic GreenMailExtension withPerMethodLifecycle(boolean perMethod)
perMethod - If true, per-method lifecycle is used, per-class
otherwise.protected GreenMail getGreenMail()
getGreenMail in class GreenMailProxypublic GreenMailExtension withConfiguration(GreenMailConfiguration config)
withConfiguration in interface GreenMailOperationswithConfiguration in class ConfiguredGreenMailCopyright © 2006–2020 Icegreen Technologies. All rights reserved.