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 GitPostCommitHookImplementerTest method shouldReturnEmptyListIfParamHasNoValueForRepoURL.
@Test
public void shouldReturnEmptyListIfParamHasNoValueForRepoURL() throws Exception {
GitMaterial material1 = mock(GitMaterial.class);
when(material1.getUrlArgument()).thenReturn(new UrlArgument("https://machine.local.git"));
Set<Material> materials = new HashSet<>(Arrays.asList(material1));
HashMap params = new HashMap();
params.put(GitPostCommitHookImplementer.REPO_URL_PARAM_KEY, "");
Set<Material> actual = implementer.prune(materials, params);
assertThat(actual.size(), is(0));
verifyNoMoreInteractions(material1);
}
use of com.thoughtworks.go.util.command.UrlArgument in project gocd by gocd.
the class MaterialConfigsMother method svnMaterialConfig.
public static SvnMaterialConfig svnMaterialConfig(String svnUrl, String folder, boolean autoUpdate) {
SvnMaterialConfig materialConfig = new SvnMaterialConfig(new UrlArgument(svnUrl), "user", "pass", true, new GoCipher(), autoUpdate, new Filter(new IgnoredFiles("*.doc")), false, folder, new CaseInsensitiveString("svn-material"));
materialConfig.setPassword("pass");
return materialConfig;
}
Aggregations