use of com.thoughtworks.go.domain.materials.svn.SvnMaterialInstance in project gocd by gocd.
the class MaterialRepositoryIntegrationTest method shouldBeAbleToPersistAMaterial.
@Test
public void shouldBeAbleToPersistAMaterial() throws Exception {
MaterialInstance original = new SvnMaterialInstance("url", "username", UUID.randomUUID().toString(), true);
repo.saveOrUpdate(original);
MaterialInstance loaded = repo.find(original.getId());
assertThat(loaded, is(original));
}
use of com.thoughtworks.go.domain.materials.svn.SvnMaterialInstance in project gocd by gocd.
the class MaterialRepositoryIntegrationTest method shouldPersistModifiedFiles.
@Test
public void shouldPersistModifiedFiles() throws Exception {
MaterialInstance original = new SvnMaterialInstance("url", "username", UUID.randomUUID().toString(), true);
Modification modification = new Modification("user", "comment", "email", new Date(), ModificationsMother.nextRevision());
modification.createModifiedFile("file1", "folder1", ModifiedAction.added);
modification.createModifiedFile("file2", "folder2", ModifiedAction.deleted);
repo.saveOrUpdate(original);
MaterialInstance loaded = repo.find(original.getId());
assertThat(loaded, is(original));
}
use of com.thoughtworks.go.domain.materials.svn.SvnMaterialInstance in project gocd by gocd.
the class PipelineMaterialRevisionTest method modification.
private Modification modification(Date date, String s, String label, Long id) {
Modification latestModification = new Modification(date, s, label, id);
latestModification.setMaterialInstance(new SvnMaterialInstance("url", "loser", "ufo", true));
return latestModification;
}
use of com.thoughtworks.go.domain.materials.svn.SvnMaterialInstance in project gocd by gocd.
the class ModificationTest method shouldCopyConstructor.
@Test
public void shouldCopyConstructor() {
Modification modification = new Modification("user", "comment", "foo@bar.com", new Date(), "pipe/1/stage/2");
Map<String, String> additionalData = new HashMap<>();
additionalData.put("a1", "v1");
additionalData.put("a2", "v2");
modification.setAdditionalData(new Gson().toJson(additionalData));
MaterialInstance original = new SvnMaterialInstance("url", "username", UUID.randomUUID().toString(), true);
modification.setMaterialInstance(original);
assertThat(new Modification(modification), is(modification));
modification = new Modification(new Date(), "rev", "label", 121L);
Modification copiedModification = new Modification(modification);
assertThat(copiedModification, is(modification));
assertThat(copiedModification.getAdditionalDataMap(), is(modification.getAdditionalDataMap()));
}
use of com.thoughtworks.go.domain.materials.svn.SvnMaterialInstance in project gocd by gocd.
the class MaterialRepositoryIntegrationTest method shouldPersistModificationsWithMaterials.
@Test
public void shouldPersistModificationsWithMaterials() throws Exception {
MaterialInstance original = new SvnMaterialInstance("url", "username", UUID.randomUUID().toString(), false);
repo.saveOrUpdate(original);
MaterialInstance loaded = repo.find(original.getId());
assertThat(loaded, is(original));
}
Aggregations