use of com.thoughtworks.go.domain.JobInstance in project gocd by gocd.
the class ArtifactPropertiesGeneratorRepositoryIntegrationTest method shouldSaveArtifactPropertiesGenerator.
@Test
public void shouldSaveArtifactPropertiesGenerator() {
// Arrange
JobInstance jobInstance = jobInstanceDao.save(stageId, new JobInstance(JOB_NAME));
ArtifactPropertiesGenerator artifactPropertiesGenerator = new ArtifactPropertiesGenerator("test", "src", "//xpath");
artifactPropertiesGenerator.setJobId(jobInstance.getId());
// Act
artifactPropertiesGeneratorRepository.save(artifactPropertiesGenerator);
// Assert
assertThat(artifactPropertiesGenerator.getId(), is(not(nullValue())));
}
use of com.thoughtworks.go.domain.JobInstance in project gocd by gocd.
the class ArtifactPropertiesGeneratorRepositoryIntegrationTest method shouldLoadSavedArtifactPropertiesGenerator.
@Test
public void shouldLoadSavedArtifactPropertiesGenerator() {
// Arrange
JobInstance jobInstance = jobInstanceDao.save(stageId, new JobInstance(JOB_NAME));
ArtifactPropertiesGenerator savedArtifactPropertiesGenerator = new ArtifactPropertiesGenerator("test", "src", "//xpath");
savedArtifactPropertiesGenerator.setJobId(jobInstance.getId());
artifactPropertiesGeneratorRepository.save(savedArtifactPropertiesGenerator);
// Act
List<ArtifactPropertiesGenerator> artifactPropertiesGeneratorList = artifactPropertiesGeneratorRepository.findByBuildId(jobInstance.getId());
// Assert
assertThat(artifactPropertiesGeneratorList.size(), is(1));
assertThat(artifactPropertiesGeneratorList.get(0), is(savedArtifactPropertiesGenerator));
}
use of com.thoughtworks.go.domain.JobInstance in project gocd by gocd.
the class ResourceRepositoryIntegrationTest method shouldLoadSavedResource.
@Test
public void shouldLoadSavedResource() {
// Arrange
JobInstance jobInstance = jobInstanceDao.save(stageId, new JobInstance(JOB_NAME));
Resource savedResource = new Resource("something");
savedResource.setBuildId(jobInstance.getId());
resourceRepository.save(savedResource);
// Act
List<Resource> resourceList = resourceRepository.findByBuildId(jobInstance.getId());
// Assert
assertThat(resourceList.size(), is(1));
assertThat(resourceList.get(0), is(savedResource));
}
use of com.thoughtworks.go.domain.JobInstance in project gocd by gocd.
the class PipelineSchedulerIntegrationTest method returnPipelineForBuildDetailViewShouldContainOnlyMods.
@Test
public void returnPipelineForBuildDetailViewShouldContainOnlyMods() throws Exception {
Pipeline pipeline = createPipelineWithStagesAndMods();
JobInstance job = pipeline.getFirstStage().getJobInstances().first();
Pipeline slimPipeline = pipelineService.wrapBuildDetails(job);
assertThat(slimPipeline.getBuildCause().getMaterialRevisions().totalNumberOfModifications(), is(1));
assertThat(slimPipeline.getName(), is(pipeline.getName()));
assertThat(slimPipeline.getFirstStage().getJobInstances().size(), is(1));
}
use of com.thoughtworks.go.domain.JobInstance in project gocd by gocd.
the class RestfulServiceTest method shouldFindJobByPipelineCounter.
@Test
public void shouldFindJobByPipelineCounter() throws Exception {
Pipeline pipeline = fixture.createdPipelineWithAllStagesPassed();
Stage stage = pipeline.getStages().byName(fixture.devStage);
JobInstance job = stage.getJobInstances().first();
JobIdentifier result = restfulService.findJob(pipeline.getName(), String.valueOf(pipeline.getCounter()), stage.getName(), String.valueOf(stage.getCounter()), job.getName(), job.getId());
JobIdentifier expect = new JobIdentifier(pipeline, stage, job);
assertThat(result, is(expect));
}
Aggregations