use of org.subethamail.wiser.Wiser in project Activiti by Activiti.
the class EmailServiceTaskTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
wiser = new Wiser();
wiser.setPort(5025);
wiser.start();
}
use of org.subethamail.wiser.Wiser in project Activiti by Activiti.
the class EmailSendTaskTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
boolean serverUpAndRunning = false;
while (!serverUpAndRunning) {
wiser = new Wiser();
wiser.setPort(5025);
try {
wiser.start();
serverUpAndRunning = true;
} catch (RuntimeException e) {
// Fix for slow port-closing Jenkins
if (e.getMessage().toLowerCase().contains("BindException")) {
Thread.sleep(250L);
}
}
}
}
use of org.subethamail.wiser.Wiser in project sonarqube by SonarSource.
the class IssueNotificationsTest method before.
@BeforeClass
public static void before() throws Exception {
smtpServer = new Wiser(0);
smtpServer.start();
System.out.println("SMTP Server port: " + smtpServer.getServer().getPort());
// Configure Sonar
resetEmailSettings(ORCHESTRATOR);
setServerProperty(ORCHESTRATOR, "email.smtp_host.secured", "localhost");
setServerProperty(ORCHESTRATOR, "email.smtp_port.secured", Integer.toString(smtpServer.getServer().getPort()));
// Send test email to the test user
newAdminWsClient(ORCHESTRATOR).wsConnector().call(new PostRequest("api/emails/send").setParam("to", USER_EMAIL).setParam("message", "This is a test message from SonarQube")).failIfNotSuccessful();
// We need to wait until all notifications will be delivered
waitUntilAllNotificationsAreDelivered(1);
Iterator<WiserMessage> emails = smtpServer.getMessages().iterator();
MimeMessage message = emails.next().getMimeMessage();
assertThat(message.getHeader("To", null)).isEqualTo("<" + USER_EMAIL + ">");
assertThat((String) message.getContent()).contains("This is a test message from SonarQube");
assertThat(emails.hasNext()).isFalse();
}
use of org.subethamail.wiser.Wiser in project sonarqube by SonarSource.
the class QualityGateNotificationTest method init.
@BeforeClass
public static void init() throws Exception {
DEFAULT_QUALITY_GATE = qgClient().list().defaultGate().id();
setServerProperty(orchestrator, "sonar.leak.period", "previous_analysis");
resetEmailSettings(orchestrator);
smtpServer = new Wiser(0);
smtpServer.start();
}
use of org.subethamail.wiser.Wiser in project sling by apache.
the class WiserSmtpService method activate.
@Activate
public void activate(final WiserSmtpServiceConfiguration configuration) throws Exception {
wiser = new Wiser(configuration.smtpPort());
wiser.start();
}
Aggregations