use of org.jenkinsci.plugins.casc.misc.ConfiguredWithCode in project configuration-as-code-plugin by jenkinsci.
the class GitToolInstallationTest method configure_git_installations.
@Test
@ConfiguredWithCode("GitToolInstallationTest.yml")
public void configure_git_installations() throws Exception {
final Jenkins jenkins = Jenkins.getInstance();
final GitTool.DescriptorImpl descriptor = (GitTool.DescriptorImpl) jenkins.getDescriptor(GitTool.class);
assertEquals(2, descriptor.getInstallations().length);
assertEquals("/usr/local/bin/git", descriptor.getInstallation("another_git").getGitExe());
assertEquals("/bin/git", descriptor.getInstallation("git").getGitExe());
}
use of org.jenkinsci.plugins.casc.misc.ConfiguredWithCode in project configuration-as-code-plugin by jenkinsci.
the class GithubOrganisationFolderTest method configure_github_organisation_folder_seed_job.
// @Test
// Fails as Items do override submit() with manual data-binding implementation
@ConfiguredWithCode("GithubOrganisationFolderTest.yml")
public void configure_github_organisation_folder_seed_job() throws Exception {
final TopLevelItem job = Jenkins.getInstance().getItem("ndeloof");
assertNotNull(job);
assertTrue(job instanceof OrganizationFolder);
OrganizationFolder folder = (OrganizationFolder) job;
assertEquals(1, folder.getNavigators().size());
final GitHubSCMNavigator github = folder.getNavigators().get(GitHubSCMNavigator.class);
assertNotNull(github);
assertEquals("ndeloof", github.getRepoOwner());
}
use of org.jenkinsci.plugins.casc.misc.ConfiguredWithCode in project configuration-as-code-plugin by jenkinsci.
the class GlobalLibrariesTest method configure_global_library.
@Test
@ConfiguredWithCode("GlobalLibrariesTest.yml")
public void configure_global_library() throws Exception {
assertEquals(1, GlobalLibraries.get().getLibraries().size());
final LibraryConfiguration library = GlobalLibraries.get().getLibraries().get(0);
assertEquals("awesome-lib", library.getName());
final SCMSourceRetriever retriever = (SCMSourceRetriever) library.getRetriever();
final GitSCMSource scm = (GitSCMSource) retriever.getScm();
assertEquals("https://github.com/jenkins-infra/pipeline-library.git", scm.getRemote());
}
use of org.jenkinsci.plugins.casc.misc.ConfiguredWithCode in project configuration-as-code-plugin by jenkinsci.
the class JenkinsConfiguratorTest method jenkins_abstract_describable_attributes.
@Test
@ConfiguredWithCode("HeteroDescribable.yml")
public void jenkins_abstract_describable_attributes() throws Exception {
final Jenkins jenkins = Jenkins.getInstance();
assertTrue(jenkins.getSecurityRealm() instanceof HudsonPrivateSecurityRealm);
assertTrue(jenkins.getAuthorizationStrategy() instanceof FullControlOnceLoggedInAuthorizationStrategy);
assertFalse(((FullControlOnceLoggedInAuthorizationStrategy) jenkins.getAuthorizationStrategy()).isAllowAnonymousRead());
}
use of org.jenkinsci.plugins.casc.misc.ConfiguredWithCode in project configuration-as-code-plugin by jenkinsci.
the class LDAPSecurityRealmTest method configure_securityRealm.
@Test
@ConfiguredWithCode("LDAPSecurityRealmTest.yml")
public void configure_securityRealm() {
final Jenkins jenkins = Jenkins.getInstance();
final LDAPSecurityRealm securityRealm = (LDAPSecurityRealm) jenkins.getSecurityRealm();
assertEquals(1, securityRealm.getConfigurations().size());
assertTrue(securityRealm.getUserIdStrategy() instanceof IdStrategy.CaseInsensitive);
assertTrue(securityRealm.getGroupIdStrategy() instanceof IdStrategy.CaseSensitive);
final LDAPConfiguration configuration = securityRealm.getConfigurations().get(0);
assertEquals("ldap.acme.com", configuration.getServer());
assertEquals("SECRET", configuration.getManagerPassword());
}
Aggregations