use of com.thoughtworks.go.config.ConfigSaveValidationContext in project gocd by gocd.
the class ScmMaterialConfigTest method shouldNotValidateEmptyDestinationFolder.
@Test
public void shouldNotValidateEmptyDestinationFolder() {
material.setConfigAttributes(Collections.singletonMap(ScmMaterialConfig.FOLDER, ""));
material.validate(new ConfigSaveValidationContext(null));
assertThat(material.errors.isEmpty(), is(true));
}
use of com.thoughtworks.go.config.ConfigSaveValidationContext in project gocd by gocd.
the class GitMaterialConfigTest method validate_shouldEnsureUrlIsNotBlank.
@Test
public void validate_shouldEnsureUrlIsNotBlank() {
GitMaterialConfig gitMaterialConfig = new GitMaterialConfig("");
gitMaterialConfig.validate(new ConfigSaveValidationContext(null));
assertThat(gitMaterialConfig.errors().on(GitMaterialConfig.URL), is("URL cannot be blank"));
}
use of com.thoughtworks.go.config.ConfigSaveValidationContext in project gocd by gocd.
the class SCMTest method shouldValidateIfNameIsMissing.
@Test
public void shouldValidateIfNameIsMissing() {
SCM scm = new SCM();
scm.validate(new ConfigSaveValidationContext(new BasicCruiseConfig(), null));
assertThat(scm.errors().getAllOn(SCM.NAME), is(asList("Please provide name")));
}
Aggregations