Search in sources :

Example 1 with SCMRetriever

use of org.jenkinsci.plugins.workflow.libs.SCMRetriever in project configuration-as-code-plugin by jenkinsci.

the class GitTest method checkAssemblaWebIsLoaded.

@Test
@Issue("JENKINS-57604")
@ConfiguredWithCode("GitTest.yml")
public void checkAssemblaWebIsLoaded() {
    final Jenkins jenkins = Jenkins.get();
    final GlobalLibraries libs = jenkins.getExtensionList(GlobalConfiguration.class).get(GlobalLibraries.class);
    LibraryConfiguration lib = libs.getLibraries().get(0);
    SCMRetriever retriever = (SCMRetriever) lib.getRetriever();
    GitSCM scm = (GitSCM) retriever.getScm();
    AssemblaWeb browser = (AssemblaWeb) scm.getBrowser();
    assertEquals("assembla.acmecorp.com", browser.getRepoUrl());
}
Also used : Jenkins(jenkins.model.Jenkins) GlobalConfiguration(jenkins.model.GlobalConfiguration) AssemblaWeb(hudson.plugins.git.browser.AssemblaWeb) GlobalLibraries(org.jenkinsci.plugins.workflow.libs.GlobalLibraries) SCMRetriever(org.jenkinsci.plugins.workflow.libs.SCMRetriever) LibraryConfiguration(org.jenkinsci.plugins.workflow.libs.LibraryConfiguration) GitSCM(hudson.plugins.git.GitSCM) Issue(org.jvnet.hudson.test.Issue) Test(org.junit.Test) ConfiguredWithCode(io.jenkins.plugins.casc.misc.ConfiguredWithCode)

Aggregations

GitSCM (hudson.plugins.git.GitSCM)1 AssemblaWeb (hudson.plugins.git.browser.AssemblaWeb)1 ConfiguredWithCode (io.jenkins.plugins.casc.misc.ConfiguredWithCode)1 GlobalConfiguration (jenkins.model.GlobalConfiguration)1 Jenkins (jenkins.model.Jenkins)1 GlobalLibraries (org.jenkinsci.plugins.workflow.libs.GlobalLibraries)1 LibraryConfiguration (org.jenkinsci.plugins.workflow.libs.LibraryConfiguration)1 SCMRetriever (org.jenkinsci.plugins.workflow.libs.SCMRetriever)1 Test (org.junit.Test)1 Issue (org.jvnet.hudson.test.Issue)1