Search in sources :

Example 21 with JobTemplate

use of com.palantir.stash.stashbot.persistence.JobTemplate in project stashbot by palantir.

the class MockJobTemplateFactory method generateDefaultsForRepo.

public void generateDefaultsForRepo(Repository repo, RepositoryConfiguration rc) throws Exception {
    JobTemplate verifyCommit = getJobTemplate(repo, rc, JobType.VERIFY_COMMIT);
    JobTemplate verifyPR = getJobTemplate(repo, rc, JobType.VERIFY_PR);
    JobTemplate publish = getJobTemplate(repo, rc, JobType.PUBLISH);
    Mockito.when(jtm.getDefaultVerifyJob()).thenReturn(verifyCommit);
    Mockito.when(jtm.getDefaultVerifyPullRequestJob()).thenReturn(verifyPR);
    Mockito.when(jtm.getDefaultPublishJob()).thenReturn(publish);
}
Also used : JobTemplate(com.palantir.stash.stashbot.persistence.JobTemplate)

Aggregations

JobTemplate (com.palantir.stash.stashbot.persistence.JobTemplate)21 Test (org.junit.Test)9 Job (com.offbytwo.jenkins.model.Job)6 RepositoryConfiguration (com.palantir.stash.stashbot.persistence.RepositoryConfiguration)5 JenkinsServerConfiguration (com.palantir.stash.stashbot.persistence.JenkinsServerConfiguration)4 IOException (java.io.IOException)4 SQLException (java.sql.SQLException)4 DBParam (net.java.ao.DBParam)4 PullRequest (com.atlassian.stash.pull.PullRequest)2 Repository (com.atlassian.stash.repository.Repository)2 JenkinsServer (com.offbytwo.jenkins.JenkinsServer)2 JobMapping (com.palantir.stash.stashbot.persistence.JobMapping)2 URISyntaxException (java.net.URISyntaxException)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ServletException (javax.servlet.ServletException)2 HttpResponseException (org.apache.http.client.HttpResponseException)2 BuildStatus (com.atlassian.stash.build.BuildStatus)1 State (com.atlassian.stash.build.BuildStatus.State)1 InternalBuildStatus (com.atlassian.stash.internal.build.InternalBuildStatus)1