Search in sources :

Example 21 with ConfiguredWithCode

use of org.jenkinsci.plugins.casc.misc.ConfiguredWithCode in project configuration-as-code-plugin by jenkinsci.

the class MailerTest method configure_mailer.

@Test
@ConfiguredWithCode("MailerTest.yml")
public void configure_mailer() throws Exception {
    final Jenkins jenkins = Jenkins.getInstance();
    final Mailer.DescriptorImpl descriptor = (Mailer.DescriptorImpl) jenkins.getDescriptor(Mailer.class);
    assertEquals("4441", descriptor.getSmtpPort());
    assertEquals("do-not-reply@acme.org", descriptor.getReplyToAddress());
    // FIXME setAdminAddress is deprecated and should NOT be set this way
    // see https://github.com/jenkinsci/mailer-plugin/pull/39
    assertEquals("admin@acme.org", descriptor.getAdminAddress());
}
Also used : Jenkins(jenkins.model.Jenkins) Mailer(hudson.tasks.Mailer) Test(org.junit.Test) ConfiguredWithCode(org.jenkinsci.plugins.casc.misc.ConfiguredWithCode)

Aggregations

ConfiguredWithCode (org.jenkinsci.plugins.casc.misc.ConfiguredWithCode)21 Test (org.junit.Test)20 Jenkins (jenkins.model.Jenkins)13 Issue (org.jvnet.hudson.test.Issue)3 DockerCloud (com.nirima.jenkins.plugins.docker.DockerCloud)2 DockerTemplate (com.nirima.jenkins.plugins.docker.DockerTemplate)2 TopLevelItem (hudson.model.TopLevelItem)2 User (hudson.model.User)2 FullControlOnceLoggedInAuthorizationStrategy (hudson.security.FullControlOnceLoggedInAuthorizationStrategy)2 HudsonPrivateSecurityRealm (hudson.security.HudsonPrivateSecurityRealm)2 ArrayList (java.util.ArrayList)2 AdminWhitelistRule (jenkins.security.s2m.AdminWhitelistRule)2 Folder (com.cloudbees.hudson.plugins.folder.Folder)1 BasicSSHUserPrivateKey (com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey)1 CertificateCredentials (com.cloudbees.plugins.credentials.common.CertificateCredentials)1 UsernamePasswordCredentials (com.cloudbees.plugins.credentials.common.UsernamePasswordCredentials)1 Role (com.michelin.cio.hudson.plugins.rolestrategy.Role)1 RoleBasedAuthorizationStrategy (com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy)1 Computer (hudson.model.Computer)1 FreeStyleProject (hudson.model.FreeStyleProject)1