Search in sources :

Example 1 with ServerSetup

use of com.icegreen.greenmail.util.ServerSetup in project books by aidanwhiteley.

the class SignUpNotificationServiceTest method setUp.

@Before
public void setUp() {
    smtpServer = new GreenMail(new ServerSetup(PORT, null, "smtp"));
    smtpServer.start();
}
Also used : GreenMail(com.icegreen.greenmail.util.GreenMail) ServerSetup(com.icegreen.greenmail.util.ServerSetup) Before(org.junit.Before)

Example 2 with ServerSetup

use of com.icegreen.greenmail.util.ServerSetup in project oozie by apache.

the class TestSLAEmailEventListener method setUp.

@Before
@Override
protected void setUp() throws Exception {
    super.setUp();
    services = new Services();
    conf = services.getConf();
    conf.set(EmailActionExecutor.EMAIL_SMTP_HOST, "localhost");
    conf.set(EmailActionExecutor.EMAIL_SMTP_PORT, String.valueOf(SMTP_TEST_PORT));
    conf.set(EmailActionExecutor.EMAIL_SMTP_AUTH, "false");
    conf.set(EmailActionExecutor.EMAIL_SMTP_USER, "");
    conf.set(EmailActionExecutor.EMAIL_SMTP_PASS, "");
    conf.set(EmailActionExecutor.EMAIL_SMTP_FROM, "oozie@localhost");
    conf.set(SLAEmailEventListener.BLACKLIST_CACHE_TIMEOUT, "1");
    conf.set(SLAEmailEventListener.BLACKLIST_FAIL_COUNT, "2");
    conf.set(SLAService.CONF_ALERT_EVENTS, SLAEvent.EventStatus.START_MISS.name() + "," + SLAEvent.EventStatus.END_MISS + "," + SLAEvent.EventStatus.DURATION_MISS);
    greenMail = new GreenMail(new ServerSetup(SMTP_TEST_PORT, null, "smtp"));
    greenMail.start();
    services.init();
    slaEmailListener = new SLAEmailEventListener();
    slaEmailListener.init(conf);
}
Also used : Services(org.apache.oozie.service.Services) GreenMail(com.icegreen.greenmail.util.GreenMail) ServerSetup(com.icegreen.greenmail.util.ServerSetup) SLAEmailEventListener(org.apache.oozie.sla.listener.SLAEmailEventListener) Before(org.junit.Before)

Example 3 with ServerSetup

use of com.icegreen.greenmail.util.ServerSetup in project syncope by apache.

the class AbstractNotificationTaskITCase method startGreenMail.

@BeforeAll
public static void startGreenMail() {
    Properties props = new Properties();
    try (InputStream propStream = ExceptionMapperITCase.class.getResourceAsStream("/mail.properties")) {
        props.load(propStream);
    } catch (Exception e) {
        LOG.error("Could not load /mail.properties", e);
    }
    SMTP_HOST = props.getProperty("smtpHost");
    assertNotNull(SMTP_HOST);
    SMTP_PORT = Integer.parseInt(props.getProperty("smtpPort"));
    assertNotNull(SMTP_PORT);
    ServerSetup[] config = new ServerSetup[2];
    config[0] = new ServerSetup(SMTP_PORT, SMTP_HOST, ServerSetup.PROTOCOL_SMTP);
    config[1] = new ServerSetup(POP3_PORT, POP3_HOST, ServerSetup.PROTOCOL_POP3);
    greenMail = new GreenMail(config);
    greenMail.start();
}
Also used : InputStream(java.io.InputStream) ServerSetup(com.icegreen.greenmail.util.ServerSetup) GreenMail(com.icegreen.greenmail.util.GreenMail) Properties(java.util.Properties) BeforeAll(org.junit.jupiter.api.BeforeAll)

Example 4 with ServerSetup

use of com.icegreen.greenmail.util.ServerSetup in project BroadleafCommerce by BroadleafCommerce.

the class RegisterCustomerControllerTest method setupControllerTest.

@BeforeClass
protected void setupControllerTest() {
    greenMail = new GreenMail(new ServerSetup[] { new ServerSetup(30000, "127.0.0.1", ServerSetup.PROTOCOL_SMTP) });
    greenMail.start();
}
Also used : GreenMail(com.icegreen.greenmail.util.GreenMail) ServerSetup(com.icegreen.greenmail.util.ServerSetup) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with ServerSetup

use of com.icegreen.greenmail.util.ServerSetup in project BroadleafCommerce by BroadleafCommerce.

the class EmailTest method setupEmailTest.

@BeforeClass
protected void setupEmailTest() {
    greenMail = new GreenMail(new ServerSetup[] { new ServerSetup(30000, "127.0.0.1", ServerSetup.PROTOCOL_SMTP) });
    greenMail.start();
}
Also used : GreenMail(com.icegreen.greenmail.util.GreenMail) ServerSetup(com.icegreen.greenmail.util.ServerSetup) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

ServerSetup (com.icegreen.greenmail.util.ServerSetup)14 GreenMail (com.icegreen.greenmail.util.GreenMail)10 Before (org.junit.Before)5 Properties (java.util.Properties)2 BeforeClass (org.testng.annotations.BeforeClass)2 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)1 UserFilterField (com.sequenceiq.cloudbreak.common.service.user.UserFilterField)1 InputStream (java.io.InputStream)1 InetSocketAddress (java.net.InetSocketAddress)1 Date (java.util.Date)1 MimeMessage (javax.mail.internet.MimeMessage)1 Setup (org.apache.axis2.transport.testkit.tests.Setup)1 Tunnel (org.apache.axis2.transport.testkit.util.tcpmon.Tunnel)1 Services (org.apache.oozie.service.Services)1 SLAEmailEventListener (org.apache.oozie.sla.listener.SLAEmailEventListener)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1 JavaMailSender (org.springframework.mail.javamail.JavaMailSender)1 JavaMailSenderImpl (org.springframework.mail.javamail.JavaMailSenderImpl)1