use of com.thoughtworks.go.config.BasicCruiseConfig in project gocd by gocd.
the class PackageRepositoryTest method shouldValidateIfNameIsMissing.
@Test
public void shouldValidateIfNameIsMissing() {
PackageRepository packageRepository = new PackageRepository();
packageRepository.validate(new ConfigSaveValidationContext(new BasicCruiseConfig(), null));
assertThat(packageRepository.errors().getAllOn("name"), is(asList("Please provide name")));
}
use of com.thoughtworks.go.config.BasicCruiseConfig in project gocd by gocd.
the class MaterialUpdateServiceIntegrationTest method configWithMaterial.
private CruiseConfig configWithMaterial(SvnMaterialConfig goodMaterial) {
CruiseConfig config = new BasicCruiseConfig();
new GoConfigMother().addPipeline(config, "good-pipeline", "first-stage", new MaterialConfigs(goodMaterial));
return config;
}
use of com.thoughtworks.go.config.BasicCruiseConfig in project gocd by gocd.
the class ElasticAgentProfileCreateCommandTest method shouldAddElasticProfile.
@Test
public void shouldAddElasticProfile() throws Exception {
BasicCruiseConfig cruiseConfig = GoConfigMother.defaultCruiseConfig();
ElasticProfile elasticProfile = new ElasticProfile("foo", "docker");
ElasticAgentProfileCreateCommand command = new ElasticAgentProfileCreateCommand(null, elasticProfile, extension, null, null);
command.update(cruiseConfig);
assertThat(cruiseConfig.server().getElasticConfig().getProfiles().find("foo"), equalTo(elasticProfile));
}
use of com.thoughtworks.go.config.BasicCruiseConfig in project gocd by gocd.
the class DiskSpaceFullCheckerTest method simulateFullDisk.
private CruiseConfig simulateFullDisk() {
new SystemEnvironment().setProperty(SystemEnvironment.ARTIFACT_FULL_SIZE_LIMIT, "1200009M");
CruiseConfig cruiseConfig = new BasicCruiseConfig();
cruiseConfig.setServerConfig(new ServerConfig(".", new SecurityConfig()));
return cruiseConfig;
}
use of com.thoughtworks.go.config.BasicCruiseConfig in project gocd by gocd.
the class DiskSpaceWarningCheckerTest method shouldUseWarningLimit.
@Test
public void shouldUseWarningLimit() {
new SystemEnvironment().setProperty(SystemEnvironment.ARTIFACT_WARNING_SIZE_LIMIT, "1M");
CruiseConfig cruiseConfig = new BasicCruiseConfig();
cruiseConfig.setServerConfig(new ServerConfig(".", new SecurityConfig()));
ArtifactsDiskSpaceWarningChecker fullChecker = new ArtifactsDiskSpaceWarningChecker(new SystemEnvironment(), sender, goConfigService, new SystemDiskSpaceChecker(), serverHealthService);
assertThat(fullChecker.limitInMb(), is(1L));
}
Aggregations