use of com.icegreen.greenmail.util.ServerSetup in project xwiki-platform by xwiki.
the class AbstractMailIntegrationTest method getCustomServerSetup.
protected ServerSetup getCustomServerSetup(ServerSetup setup) {
// Increase startup timeout (default is 1s, which can be too fast on slow CI agents).
ServerSetup newSetup = setup.createCopy();
newSetup.setServerStartupTimeout(5000L);
return newSetup;
}
use of com.icegreen.greenmail.util.ServerSetup in project cloudbreak by hortonworks.
the class EmailSenderHostServiceTypeTest method before.
@Before
public void before() throws IOException, TemplateException {
greenMail = new GreenMail(new ServerSetup(3465, null, ServerSetup.PROTOCOL_SMTP));
greenMail.setUser("demouser", "demopwd");
greenMail.start();
IdentityUser identityUser = new IdentityUser("sdf", "testuser", "testaccount", new ArrayList<>(), "familyname", "givenName", new Date());
ReflectionTestUtils.setField(emailSenderService, "freemarkerConfiguration", freemarkerConfiguration());
ReflectionTestUtils.setField(emailSenderService, "successClusterMailTemplatePath", "templates/cluster-installer-mail-success.ftl");
ReflectionTestUtils.setField(emailSenderService, "failedClusterMailTemplatePath", "templates/cluster-installer-mail-fail.ftl");
JavaMailSender mailSender = new JavaMailSenderImpl();
((JavaMailSenderImpl) mailSender).setHost("localhost");
((JavaMailSenderImpl) mailSender).setPort(3465);
((JavaMailSenderImpl) mailSender).setUsername("demouser2");
((JavaMailSenderImpl) mailSender).setPassword("demopwd2");
Properties props = new Properties();
props.put("mail.transport.protocol", "smtp");
props.put("mail.smtp.auth", false);
props.put("mail.smtp.starttls.enable", false);
props.put("mail.debug", false);
((JavaMailSenderImpl) mailSender).setJavaMailProperties(props);
ReflectionTestUtils.setField(emailSenderService, "mailSender", mailSender);
EmailMimeMessagePreparator mmp = new EmailMimeMessagePreparator();
ReflectionTestUtils.setField(mmp, "msgFrom", "no-reply@hortonworks.com");
ReflectionTestUtils.setField(emailSenderService, "emailMimeMessagePreparator", mmp);
when(userDetailsService.getDetails(anyString(), any(UserFilterField.class))).thenReturn(identityUser);
}
use of com.icegreen.greenmail.util.ServerSetup in project ninja by ninjaframework.
the class CommonsMailHelperImplGreenmailIntegrationTest method setUp.
@Before
public final void setUp() {
SMTP_TEST_PORT = findAvailablePort(2000, 10000);
greenMail = new GreenMail(new ServerSetup(SMTP_TEST_PORT, null, "smtp"));
greenMail.start();
}
use of com.icegreen.greenmail.util.ServerSetup in project c4sg-services by Code4SocialGood.
the class EmailServiceTest method setUp.
@Before
public void setUp() {
mailer = new GreenMail(new ServerSetup(8825, null, "smtp"));
mailer.start();
}
Aggregations