use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class PipelineConfigSaveValidationContextTest method shouldGetAllMaterialsByFingerPrint.
@Test
void shouldGetAllMaterialsByFingerPrint() throws Exception {
CruiseConfig cruiseConfig = new GoConfigMother().cruiseConfigWithPipelineUsingTwoMaterials();
MaterialConfig expectedMaterial = MaterialConfigsMother.multipleMaterialConfigs().get(1);
PipelineConfigSaveValidationContext context = PipelineConfigSaveValidationContext.forChain(true, "group", cruiseConfig);
MaterialConfigs allMaterialsByFingerPrint = context.getAllMaterialsByFingerPrint(expectedMaterial.getFingerprint());
assertThat(allMaterialsByFingerPrint.size()).isEqualTo(1);
assertThat(allMaterialsByFingerPrint.first()).isEqualTo(expectedMaterial);
}
use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class PipelineConfigValidationTest method setup.
@BeforeEach
void setup() {
config = GoConfigMother.configWithPipelines("pipeline1", "pipeline2", "pipeline3", "go");
pipeline = config.pipelineConfigByName(new CaseInsensitiveString("go"));
goConfigMother = new GoConfigMother();
}
use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class UpdatePackageConfigCommandTest method setup.
@BeforeEach
public void setup() throws Exception {
currentUser = new Username(new CaseInsensitiveString("user"));
cruiseConfig = new GoConfigMother().defaultCruiseConfig();
packageUuid = "random-uuid";
configuration = new Configuration(new ConfigurationProperty(new ConfigurationKey("PACKAGE_ID"), new ConfigurationValue("foo")));
oldPackageDefinition = new PackageDefinition(packageUuid, "prettyjson", configuration);
newPackageName = "prettyjson";
newPackageDefinition = new PackageDefinition(packageUuid, newPackageName, configuration);
result = new HttpLocalizedOperationResult();
PackageRepositories repositories = cruiseConfig.getPackageRepositories();
PackageRepository repository = new PackageRepository("repoId", "repoName", new PluginConfiguration("plugin-id", "1"), new Configuration(new ConfigurationProperty(new ConfigurationKey("foo"), new ConfigurationValue("bar"))));
repository.addPackage(oldPackageDefinition);
oldPackageDefinition.setRepository(repository);
repositories.add(repository);
cruiseConfig.setPackageRepositories(repositories);
}
use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class CcTrayConfigChangeHandlerTest method setUp.
@BeforeEach
public void setUp() throws Exception {
goConfigMother = new GoConfigMother();
handler = new CcTrayConfigChangeHandler(cache, stageStatusLoader, pipelinePermissionsAuthority);
pluginRoleUsersStore = PluginRoleUsersStore.instance();
}
use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class GoDashboardConfigChangeHandlerTest method shouldReplaceOnlyTheExistingPipelineEntryInCacheWithANewEntryWhenOnlyPipelineConfigHasChanged.
@Test
public void shouldReplaceOnlyTheExistingPipelineEntryInCacheWithANewEntryWhenOnlyPipelineConfigHasChanged() throws Exception {
BasicCruiseConfig config = GoConfigMother.defaultCruiseConfig();
PipelineConfig pipelineConfig = new GoConfigMother().addPipeline(config, "pipeline1", "stage1", "job1");
handler.call(pipelineConfig);
verify(cacheUpdateService).updateCacheForPipeline(pipelineConfig);
}
Aggregations