Search in sources :

Example 1 with MailerGlobalConfig

use of org.jenkinsci.test.acceptance.plugins.mailer.MailerGlobalConfig in project acceptance-test-harness by jenkinsci.

the class MailhogProvider method get.

@Override
public synchronized MailhogContainer get() {
    MailhogContainer mailhog = super.get();
    jenkins.configure(() -> {
        MailerGlobalConfig mgc = new MailerGlobalConfig(jenkins);
        mgc.smtpServer.set(mailhog.getSmtpHost());
        mgc.advancedButton.click();
        mgc.smtpPort.set(mailhog.getSmtpPort());
    });
    return mailhog;
}
Also used : MailerGlobalConfig(org.jenkinsci.test.acceptance.plugins.mailer.MailerGlobalConfig) MailhogContainer(org.jenkinsci.test.acceptance.docker.fixtures.MailhogContainer)

Example 2 with MailerGlobalConfig

use of org.jenkinsci.test.acceptance.plugins.mailer.MailerGlobalConfig in project acceptance-test-harness by jenkinsci.

the class Mailtrap method setup.

/**
 * Set up the configuration to use the shared mailtrap.io account.
 */
@Override
public void setup(Jenkins jenkins) {
    jenkins.configure();
    MailerGlobalConfig config = new MailerGlobalConfig(jenkins);
    config.smtpServer.set(HOST);
    config.advancedButton.click();
    config.useSMTPAuth.check();
    config.smtpAuthUserName.set(MAILBOX);
    config.smtpAuthPassword.set(PASSWORD);
    config.smtpPort.set(PORT);
    // Fingerprint to identify message sent from this test run
    config.replyToAddress.set(fingerprint);
    jenkins.save();
    // Set for email-ext plugin as well if available
    if (jenkins.getPluginManager().isInstalled("email-ext")) {
        // For whatever reason this needs new config page opened
        jenkins.configure();
        GlobalConfig ext = new GlobalConfig(jenkins.getConfigPage());
        ext.smtpServer(HOST);
        ext.auth(MAILBOX, PASSWORD);
        ext.smtpPort(PORT);
        ext.replyTo(fingerprint);
        jenkins.save();
    }
}
Also used : MailerGlobalConfig(org.jenkinsci.test.acceptance.plugins.mailer.MailerGlobalConfig) MailerGlobalConfig(org.jenkinsci.test.acceptance.plugins.mailer.MailerGlobalConfig) GlobalConfig(org.jenkinsci.test.acceptance.plugins.email_ext.GlobalConfig)

Aggregations

MailerGlobalConfig (org.jenkinsci.test.acceptance.plugins.mailer.MailerGlobalConfig)2 MailhogContainer (org.jenkinsci.test.acceptance.docker.fixtures.MailhogContainer)1 GlobalConfig (org.jenkinsci.test.acceptance.plugins.email_ext.GlobalConfig)1