use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class PasswordDeserializerTest method shouldReturnTheEncryptedPasswordSentByUserIfValid.
@Test
public void shouldReturnTheEncryptedPasswordSentByUserIfValid() throws CryptoException {
String encryptedPassword = new GoCipher().encrypt("password");
SvnMaterialConfig svnMaterialConfig = svn();
PasswordDeserializer passwordDeserializer = new PasswordDeserializer();
String encrypted = passwordDeserializer.deserialize(null, encryptedPassword, svnMaterialConfig);
assertThat(encrypted, is(encryptedPassword));
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class PasswordDeserializerTest method shouldReturnNullIfBothPasswordAndEncryptedPasswordAreNull.
@Test
public void shouldReturnNullIfBothPasswordAndEncryptedPasswordAreNull() {
SvnMaterialConfig svnMaterialConfig = svn();
PasswordDeserializer passwordDeserializer = new PasswordDeserializer();
String encrypted = passwordDeserializer.deserialize(null, null, svnMaterialConfig);
assertNull(encrypted);
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class PasswordDeserializerTest method shouldNotValidateEncryptedPasswordIfBlank.
@Test
public void shouldNotValidateEncryptedPasswordIfBlank() {
SvnMaterialConfig svnMaterialConfig = svn();
PasswordDeserializer passwordDeserializer = new PasswordDeserializer();
String encrypted = passwordDeserializer.deserialize(null, "", svnMaterialConfig);
assertNull(encrypted);
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class MaterialConfigsMother method svnMaterialConfig.
public static SvnMaterialConfig svnMaterialConfig(String svnUrl, String folder, boolean autoUpdate) {
SvnMaterialConfig materialConfig = svn(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;
}
use of com.thoughtworks.go.config.materials.svn.SvnMaterialConfig in project gocd by gocd.
the class MaterialConfigsMother method svn.
// there is no need to mock GoCipher as it already using test provider
public static SvnMaterialConfig svn(String url, String userName, String password, boolean checkExternals, GoCipher goCipher) {
SvnMaterialConfig svnMaterialConfig = svn();
svnMaterialConfig.setUrl(url);
svnMaterialConfig.setUserName(userName);
svnMaterialConfig.setPassword(password);
svnMaterialConfig.setCheckExternals(checkExternals);
return svnMaterialConfig;
}
Aggregations