use of com.thoughtworks.go.domain.ConfigErrors in project gocd by gocd.
the class DependencyMaterialConfigTest method shouldNOTBeValidIfTheReferencedPipelineDoesNotExist.
@Test
public void shouldNOTBeValidIfTheReferencedPipelineDoesNotExist() throws Exception {
CruiseConfig config = GoConfigMother.configWithPipelines("pipeline1", "pipeline2", "pipeline3", "go");
DependencyMaterialConfig dependencyMaterialConfig = new DependencyMaterialConfig(new CaseInsensitiveString("pipeline-not-exist"), new CaseInsensitiveString("stage"));
dependencyMaterialConfig.validate(ConfigSaveValidationContext.forChain(config, pipelineConfig));
ConfigErrors configErrors = dependencyMaterialConfig.errors();
assertThat(configErrors.isEmpty(), is(false));
assertThat(configErrors.on(DependencyMaterialConfig.PIPELINE_STAGE_NAME), containsString("Pipeline with name 'pipeline-not-exist' does not exist"));
}
Aggregations