use of com.thoughtworks.go.config.ArtifactPropertiesGenerator in project gocd by gocd.
the class ArtifactPropertiesGeneratorRepository method saveCopyOf.
public ArtifactPropertiesGenerator saveCopyOf(long jobId, ArtifactPropertiesGenerator generator) {
ArtifactPropertiesGenerator copyOfGenerator = new ArtifactPropertiesGenerator(generator);
copyOfGenerator.setJobId(jobId);
save(copyOfGenerator);
return copyOfGenerator;
}
use of com.thoughtworks.go.config.ArtifactPropertiesGenerator 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.config.ArtifactPropertiesGenerator 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));
}
Aggregations