Search in sources :

Example 1 with MavenInstaller

use of hudson.tasks.Maven.MavenInstaller in project configuration-as-code-plugin by jenkinsci.

the class MavenConfiguratorTest method configure_maven_tool.

@Test
@ConfiguredWithReadme("maven/README.md#0")
public void configure_maven_tool() {
    final Maven.DescriptorImpl descriptor = ExtensionList.lookupSingleton(Maven.DescriptorImpl.class);
    assertEquals(1, descriptor.getInstallations().length);
    Maven.MavenInstallation maven = descriptor.getInstallations()[0];
    assertEquals("maven3", maven.getName());
    assertEquals("/maven3", maven.getHome());
    InstallSourceProperty installSourceProperty = maven.getProperties().get(InstallSourceProperty.class);
    assertEquals(1, installSourceProperty.installers.size());
    MavenInstaller installer = installSourceProperty.installers.get(MavenInstaller.class);
    assertEquals("3.8.4", installer.id);
}
Also used : Maven(hudson.tasks.Maven) InstallSourceProperty(hudson.tools.InstallSourceProperty) MavenInstaller(hudson.tasks.Maven.MavenInstaller) Test(org.junit.Test) ConfiguredWithReadme(io.jenkins.plugins.casc.misc.ConfiguredWithReadme)

Aggregations

Maven (hudson.tasks.Maven)1 MavenInstaller (hudson.tasks.Maven.MavenInstaller)1 InstallSourceProperty (hudson.tools.InstallSourceProperty)1 ConfiguredWithReadme (io.jenkins.plugins.casc.misc.ConfiguredWithReadme)1 Test (org.junit.Test)1