Search in sources :

Example 1 with Tabs

use of com.thoughtworks.go.config.Tabs in project gocd by gocd.

the class JobDetailServiceTest method setUp.

@Before
public void setUp() throws Exception {
    artifactsService = context.mock(ArtifactsService.class);
    configService = context.mock(GoConfigService.class);
    jobInstanceDao = context.mock(JobInstanceDao.class);
    jobDetailService = new JobDetailService(artifactsService, jobInstanceDao, configService);
    final String jobName = "jobConfig1";
    final int id = 1;
    job = JobInstanceMother.completed(jobName, JobResult.Failed);
    job.setId(id);
    job.setIdentifier(new JobIdentifier("pipeline", "Label:1", "stage", "1", jobName));
    final Tabs tabs = new Tabs();
    customizedTab = new Tab("myArtifacts", "my/artifact/path");
    tabs.add(customizedTab);
    context.checking(new Expectations() {

        {
            one(configService).getCustomizedTabs("pipeline", "stage", jobName);
            will(returnValue(tabs));
        }
    });
}
Also used : Expectations(org.jmock.Expectations) Tab(com.thoughtworks.go.config.Tab) Tabs(com.thoughtworks.go.config.Tabs) JobIdentifier(com.thoughtworks.go.domain.JobIdentifier) JobInstanceDao(com.thoughtworks.go.server.dao.JobInstanceDao) Before(org.junit.Before)

Example 2 with Tabs

use of com.thoughtworks.go.config.Tabs in project gocd by gocd.

the class JobDetailPresentationModelJMockTest method setUp.

@Before
public void setUp() {
    stubJobInstance = context.mock(JobInstance.class);
    TrackingTool trackingTool = context.mock(TrackingTool.class);
    artifactService = context.mock(ArtifactsService.class);
    jobIdentifier = new JobIdentifier("pipeline", -1, "1", "stageName", "0", "build", 1L);
    context.checking(new Expectations() {

        {
            allowing(stubJobInstance).getName();
            will(returnValue("build"));
            allowing(stubJobInstance).getId();
            will(returnValue(1L));
            allowing(stubJobInstance).getIdentifier();
            will(returnValue(jobIdentifier));
        }
    });
    Stage stage = StageMother.custom("stageName", stubJobInstance);
    Pipeline pipeline = new Pipeline("pipeline", null, stage);
    pipeline.setId(1L);
    trackingTool = new TrackingTool();
    jobDetailPresenter = new JobDetailPresentationModel(stubJobInstance, null, null, pipeline, new Tabs(), trackingTool, artifactService, new Properties(), null);
    testFolder = TestFileUtil.createTempFolder("testFiles");
}
Also used : Expectations(org.jmock.Expectations) ArtifactsService(com.thoughtworks.go.server.service.ArtifactsService) Tabs(com.thoughtworks.go.config.Tabs) TrackingTool(com.thoughtworks.go.config.TrackingTool) Before(org.junit.Before)

Aggregations

Tabs (com.thoughtworks.go.config.Tabs)2 Expectations (org.jmock.Expectations)2 Before (org.junit.Before)2 Tab (com.thoughtworks.go.config.Tab)1 TrackingTool (com.thoughtworks.go.config.TrackingTool)1 JobIdentifier (com.thoughtworks.go.domain.JobIdentifier)1 JobInstanceDao (com.thoughtworks.go.server.dao.JobInstanceDao)1 ArtifactsService (com.thoughtworks.go.server.service.ArtifactsService)1