use of com.thoughtworks.go.config.ValidationContext in project gocd by gocd.
the class ParamConfigTest method shouldValidateName.
@Test
public void shouldValidateName() {
ParamConfig paramConfig = new ParamConfig();
ValidationContext validationContext = mock(ValidationContext.class);
when(validationContext.getPipeline()).thenReturn(new PipelineConfig(new CaseInsensitiveString("p"), null));
paramConfig.validateName(new HashMap<>(), validationContext);
assertThat(paramConfig.errors().on(ParamConfig.NAME), is("Parameter cannot have an empty name for pipeline 'p'."));
}
Aggregations