Search in sources :

Example 1 with EmailExtPublisher

use of org.jenkinsci.test.acceptance.plugins.email_ext.EmailExtPublisher in project acceptance-test-harness by jenkinsci.

the class EmailExtPluginTest method build.

@Test
public void build() {
    MailhogContainer mailhog = mailhogProvider.get();
    FreeStyleJob job = jenkins.jobs.create();
    job.configure();
    job.addShellStep("false");
    EmailExtPublisher pub = job.addPublisher(EmailExtPublisher.class);
    pub.subject.set("Modified $DEFAULT_SUBJECT");
    pub.setRecipient("dev@example.com");
    pub.body.set("$DEFAULT_CONTENT\nwith amendment");
    job.save();
    Build b = job.startBuild().shouldFail();
    mailhog.assertMail(Pattern.compile("^Modified "), "dev@example.com", Pattern.compile("\nwith amendment$"));
}
Also used : Build(org.jenkinsci.test.acceptance.po.Build) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) EmailExtPublisher(org.jenkinsci.test.acceptance.plugins.email_ext.EmailExtPublisher) MailhogContainer(org.jenkinsci.test.acceptance.docker.fixtures.MailhogContainer) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest)

Aggregations

MailhogContainer (org.jenkinsci.test.acceptance.docker.fixtures.MailhogContainer)1 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)1 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)1 EmailExtPublisher (org.jenkinsci.test.acceptance.plugins.email_ext.EmailExtPublisher)1 Build (org.jenkinsci.test.acceptance.po.Build)1 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)1 Test (org.junit.Test)1