use of com.thoughtworks.go.domain.materials.MaterialConfig in project gocd by gocd.
the class ConfigRepoConfig method validateAutoUpdateState.
private void validateAutoUpdateState(ValidationContext validationContext) {
if (validationContext == null)
return;
MaterialConfig material = this.getMaterialConfig();
MaterialConfigs allMaterialsByFingerPrint = validationContext.getAllMaterialsByFingerPrint(material.getFingerprint());
if (allMaterialsByFingerPrint != null) {
for (MaterialConfig other : allMaterialsByFingerPrint) {
if (!other.isAutoUpdate())
((ScmMaterialConfig) other).setAutoUpdateMismatchErrorWithConfigRepo();
}
}
}
use of com.thoughtworks.go.domain.materials.MaterialConfig in project gocd by gocd.
the class MaterialConfigServiceTest method shouldPopulateErrorCorrectlyWhenUnauthorizedToViewMaterial_getMaterialConfigByFingerprint.
@Test
public void shouldPopulateErrorCorrectlyWhenUnauthorizedToViewMaterial_getMaterialConfigByFingerprint() {
HttpOperationResult result = new HttpOperationResult();
GitMaterialConfig gitMaterialConfig = new GitMaterialConfig("http://another.com");
MaterialConfig materialConfig = materialConfigService.getMaterialConfig(user, gitMaterialConfig.getFingerprint(), result);
assertThat(materialConfig, is(nullValue()));
assertThat(result.httpCode(), is(401));
}
use of com.thoughtworks.go.domain.materials.MaterialConfig in project gocd by gocd.
the class MaterialConfigServiceTest method shouldGetMaterialConfigByFingerprint.
@Test
public void shouldGetMaterialConfigByFingerprint() {
HttpOperationResult result = new HttpOperationResult();
GitMaterialConfig gitMaterialConfig = new GitMaterialConfig("http://crap.com");
MaterialConfig materialConfig = materialConfigService.getMaterialConfig(user, gitMaterialConfig.getFingerprint(), result);
assertThat(materialConfig, is(gitMaterialConfig));
assertThat(result.canContinue(), is(true));
}
use of com.thoughtworks.go.domain.materials.MaterialConfig in project gocd by gocd.
the class PipelineConfig method allowedTemplateVariables.
public List<String> allowedTemplateVariables() {
List<String> names = new ArrayList<>();
for (MaterialConfig material : materialConfigs) {
if (!CaseInsensitiveString.isBlank(material.getName())) {
names.add(CaseInsensitiveString.str(material.getName()));
}
}
names.add("COUNT");
return names;
}
use of com.thoughtworks.go.domain.materials.MaterialConfig in project gocd by gocd.
the class MaterialConfigs method allowedFolders.
private List<String> allowedFolders() {
ArrayList<String> allowed = new ArrayList<>();
for (MaterialConfig material : this) {
if (!StringUtils.isBlank(material.getFolder())) {
allowed.add(material.getFolder());
}
}
allowed.add(ArtifactLogUtil.CRUISE_OUTPUT_FOLDER);
return allowed;
}
Aggregations