use of org.jenkinsci.test.acceptance.plugins.mailer.Mailer in project acceptance-test-harness by jenkinsci.
the class MailerPluginTest method send_mail_for_failed_build.
@Test
public void send_mail_for_failed_build() throws IOException {
FreeStyleJob job = jenkins.jobs.create();
job.configure();
job.addShellStep("fail");
Mailer m = job.addPublisher(Mailer.class);
m.recipients.set("dev@example.com mngmnt@example.com");
job.save();
job.startBuild().shouldFail();
mailhog.assertMail(Pattern.compile("Build failed in Jenkins: .* #1"), "dev@example.com mngmnt@example.com", Pattern.compile("failure"));
}
use of org.jenkinsci.test.acceptance.plugins.mailer.Mailer in project acceptance-test-harness by jenkinsci.
the class MavenPluginTest method send_mail.
@Test
@Issue({ "JENKINS-20209", "JENKINS-21045" })
public void send_mail() throws Exception {
installSomeMaven(jenkins);
MailhogContainer mailhog = mailhogProvider.get();
MavenModuleSet job = jenkins.jobs.create(MavenModuleSet.class);
job.configure();
Mailer mailer = job.addBuildSettings(Mailer.class);
mailer.recipients.set("root@example.com");
job.save();
job.startBuild().shouldFail();
mailhog.assertMail(Pattern.compile("Build failed in Jenkins: .* #1"), "root@example.com", Pattern.compile(job.name));
}
Aggregations