use of com.thoughtworks.go.util.command.UrlArgument in project gocd by gocd.
the class TfsMaterialPersistenceTest method shouldBeAbleToConvertAMaterialInstanceObjectToTfsMaterialObject.
@Test
public void shouldBeAbleToConvertAMaterialInstanceObjectToTfsMaterialObject() {
TfsMaterial tfsCfg = new TfsMaterial(new GoCipher(), new UrlArgument("url"), "loser", "CORPORATE", "password", "/dev/null");
tfsCfg.setFolder("folder");
tfsCfg.setName(new CaseInsensitiveString("materialName"));
MaterialInstance tfsInstance = materialRepository.findOrCreateFrom(tfsCfg);
Material material = tfsInstance.toOldMaterial("materialName", "folder", "password");
assertThat(material, is(tfsCfg));
}
use of com.thoughtworks.go.util.command.UrlArgument in project gocd by gocd.
the class TfsMaterialPersistenceTest method shouldFindOldMaterial.
@Test
public void shouldFindOldMaterial() {
TfsMaterial tfsCfg = new TfsMaterial(new GoCipher(), new UrlArgument("url"), "loser", "CORPORATE", "foo_bar_baz", "/dev/null");
MaterialInstance tfsInstance1 = materialRepository.findOrCreateFrom(tfsCfg);
goCache.clear();
MaterialInstance tfsInstance2 = materialRepository.findOrCreateFrom(tfsCfg);
assertThat(tfsInstance1, is(tfsInstance2));
}
use of com.thoughtworks.go.util.command.UrlArgument in project gocd by gocd.
the class TfsMaterialPersistenceTest method shouldSaveMaterialInstance.
@Test
public void shouldSaveMaterialInstance() throws Exception {
TfsMaterial tfsCfg = new TfsMaterial(new GoCipher(), new UrlArgument("url"), "loser", "CORPORATE", "foo_bar_baz", "/dev/null");
MaterialInstance materialInstance = materialRepository.findOrCreateFrom(tfsCfg);
assertThat(materialRepository.findMaterialInstance(tfsCfg), is(materialInstance));
}
Aggregations