use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class ConsoleActivityMonitorTest method shouldClearServerHealthMessageForARescheduledJob.
@Test
public void shouldClearServerHealthMessageForARescheduledJob() {
JobIdentifier rescheduledJobIdentifier = new JobIdentifier("foo", 10, "label-10", "stage", "3", "job", 10l);
JobInstance jobInstance = new JobInstance();
jobInstance.setIdentifier(rescheduledJobIdentifier);
jobInstance.setState(JobState.Rescheduled);
listener.jobStatusChanged(jobInstance);
verify(serverHealthService).removeByScope(HealthStateScope.forJob("foo", "stage", "job"));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class ConsoleServiceTest method shouldReturnTemporaryFileIfBothTemporaryAndFinalFilesDoNotExist.
@Test
public void shouldReturnTemporaryFileIfBothTemporaryAndFinalFilesDoNotExist() throws Exception {
JobIdentifier jobIdentifier = JobIdentifierMother.anyBuildIdentifier();
File consoleFile = mock(File.class);
when(chooser.temporaryConsoleFile(jobIdentifier)).thenReturn(consoleFile);
when(consoleFile.exists()).thenReturn(false);
File finalConsoleFile = mock(File.class);
when(chooser.findArtifact(jobIdentifier, getConsoleOutputFolderAndFileName())).thenReturn(finalConsoleFile);
when(finalConsoleFile.exists()).thenReturn(false);
File file = service.consoleLogFile(jobIdentifier);
assertThat(file, is(consoleFile));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class ConsoleServiceTest method shouldReturnFinalArtifactFileIfItExists.
@Test
public void shouldReturnFinalArtifactFileIfItExists() throws Exception {
JobIdentifier jobIdentifier = JobIdentifierMother.anyBuildIdentifier();
File consoleFile = mock(File.class);
when(chooser.temporaryConsoleFile(jobIdentifier)).thenReturn(consoleFile);
when(consoleFile.exists()).thenReturn(false);
File finalConsoleFile = mock(File.class);
when(chooser.findArtifact(jobIdentifier, getConsoleOutputFolderAndFileName())).thenReturn(finalConsoleFile);
when(finalConsoleFile.exists()).thenReturn(true);
File file = service.consoleLogFile(jobIdentifier);
assertThat(file, is(finalConsoleFile));
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class FailureServiceTest method setUp.
@Before
public void setUp() {
shineDao = mock(ShineDao.class);
securityService = mock(SecurityService.class);
stageFinder = mock(StageFinder.class);
failureService = new FailureService(securityService, shineDao, stageFinder);
username = new Username(new CaseInsensitiveString("foo"));
jobIdentifier = new JobIdentifier(new StageIdentifier("pipeline", 10, "stage", "5"), "job");
result = new HttpLocalizedOperationResult();
}
use of com.thoughtworks.go.domain.JobIdentifier in project gocd by gocd.
the class URLServiceTest method setUp.
@Before
public void setUp() {
urlService = new URLService();
jobIdentifier = new JobIdentifier("pipelineName", -2, "LATEST", "stageName", "LATEST", "buildName", 123L);
}
Aggregations