use of com.thoughtworks.go.domain.materials.Material in project gocd by gocd.
the class TfsMaterialInstanceTest method shouldSetNameAsNullIfNoNameSpecified.
@Test
public void shouldSetNameAsNullIfNoNameSpecified() {
TfsMaterialInstance instance1 = new TfsMaterialInstance("http://foo.com", "username", "CORPORATE", "some_project_path", "blah");
Material material = instance1.toOldMaterial(null, "some_folder", "password");
assertThat(material.getName(), is(nullValue()));
}
use of com.thoughtworks.go.domain.materials.Material in project gocd by gocd.
the class PipelineMaterialRevisionTest method shouldNotSetFROMRevisionSameAsTORevisionWhenSCMMaterial.
@Test
public void shouldNotSetFROMRevisionSameAsTORevisionWhenSCMMaterial() {
Material material = new HgMaterial("http://some_server/repo", null);
Modification latestModification = modification(new Date(), "123", null, null);
Modification earlierModification = modification(new Date(), "23", null, null);
MaterialRevision revision = new MaterialRevision(material, latestModification, earlierModification);
PipelineMaterialRevision pmr = new PipelineMaterialRevision(9, revision, null);
assertThat(pmr.getToModification(), is(latestModification));
assertThat(pmr.getFromModification(), is(earlierModification));
}
use of com.thoughtworks.go.domain.materials.Material in project gocd by gocd.
the class DependencyMaterialTest method shouldUseACombinationOfPipelineAndStageNameAsURI.
@Test
void shouldUseACombinationOfPipelineAndStageNameAsURI() {
Material material = new DependencyMaterial(new CaseInsensitiveString("pipeline-foo"), new CaseInsensitiveString("stage-bar"));
assertThat(material.getUriForDisplay()).isEqualTo("pipeline-foo / stage-bar");
}
use of com.thoughtworks.go.domain.materials.Material in project gocd by gocd.
the class DependencyMaterialTest method shouldNotTruncateshortRevision.
@Test
void shouldNotTruncateshortRevision() throws Exception {
Material material = new DependencyMaterial(new CaseInsensitiveString("upstream"), new CaseInsensitiveString("first"));
assertThat(material.getShortRevision("pipeline-name/1/stage-name/5")).isEqualTo("pipeline-name/1/stage-name/5");
}
use of com.thoughtworks.go.domain.materials.Material in project gocd by gocd.
the class MaterialDatabaseUpdater method initializeMaterialWithLatestRevision.
private void initializeMaterialWithLatestRevision(Material material) {
Materials materials = new Materials();
materialExpansionService.expandForHistory(material, materials);
for (Material expanded : materials) {
addNewMaterialWithModifications(folderFor(expanded), expanded, updater(expanded));
}
}
Aggregations