Search in sources :

Example 1 with JobInstanceDao

use of com.thoughtworks.go.server.dao.JobInstanceDao 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 JobInstanceDao

use of com.thoughtworks.go.server.dao.JobInstanceDao in project gocd by gocd.

the class ArtifactsControllerTest method setUp.

@BeforeEach
public void setUp() {
    consoleActivityMonitor = mock(ConsoleActivityMonitor.class);
    restfulService = mock(RestfulService.class);
    artifactService = mock(ArtifactsService.class);
    consoleService = mock(ConsoleService.class);
    jobInstanceDao = mock(JobInstanceDao.class);
    systemEnvironment = mock(SystemEnvironment.class);
    artifactsController = new ArtifactsController(artifactService, restfulService, mock(ZipArtifactCache.class), jobInstanceDao, consoleActivityMonitor, consoleService, systemEnvironment);
    request = new MockHttpServletRequest();
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) ConsoleActivityMonitor(com.thoughtworks.go.server.service.ConsoleActivityMonitor) RestfulService(com.thoughtworks.go.server.service.RestfulService) ArtifactsService(com.thoughtworks.go.server.service.ArtifactsService) MockHttpServletRequest(org.springframework.mock.web.MockHttpServletRequest) ConsoleService(com.thoughtworks.go.server.service.ConsoleService) JobInstanceDao(com.thoughtworks.go.server.dao.JobInstanceDao) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with JobInstanceDao

use of com.thoughtworks.go.server.dao.JobInstanceDao in project gocd by gocd.

the class JobControllerTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    jobInstanceService = mock(JobInstanceService.class);
    jobInstanceDao = mock(JobInstanceDao.class);
    jobConfigService = mock(GoConfigService.class);
    agentService = mock(AgentService.class);
    stageService = mock(StageService.class);
    response = new MockHttpServletResponse();
    systemEnvironment = mock(SystemEnvironment.class);
    pipelineService = mock(PipelineService.class);
    restfulService = mock(RestfulService.class);
    jobAgentMetadataDao = mock(JobAgentMetadataDao.class);
    securityService = mock(SecurityService.class);
    jobController = new JobController(jobInstanceService, agentService, jobInstanceDao, jobConfigService, pipelineService, restfulService, null, stageService, jobAgentMetadataDao, systemEnvironment, securityService);
}
Also used : SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) JobAgentMetadataDao(com.thoughtworks.go.server.dao.JobAgentMetadataDao) JobInstanceDao(com.thoughtworks.go.server.dao.JobInstanceDao) MockHttpServletResponse(org.springframework.mock.web.MockHttpServletResponse) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

JobInstanceDao (com.thoughtworks.go.server.dao.JobInstanceDao)3 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 Tab (com.thoughtworks.go.config.Tab)1 Tabs (com.thoughtworks.go.config.Tabs)1 JobIdentifier (com.thoughtworks.go.domain.JobIdentifier)1 JobAgentMetadataDao (com.thoughtworks.go.server.dao.JobAgentMetadataDao)1 ArtifactsService (com.thoughtworks.go.server.service.ArtifactsService)1 ConsoleActivityMonitor (com.thoughtworks.go.server.service.ConsoleActivityMonitor)1 ConsoleService (com.thoughtworks.go.server.service.ConsoleService)1 RestfulService (com.thoughtworks.go.server.service.RestfulService)1 Expectations (org.jmock.Expectations)1 Before (org.junit.Before)1 MockHttpServletRequest (org.springframework.mock.web.MockHttpServletRequest)1 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)1