use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class CreateConfigRepoCommandTest method setup.
@Before
public void setup() throws Exception {
initMocks(this);
currentUser = new Username(new CaseInsensitiveString("user"));
actionFailed = LocalizedMessage.string("RESOURCE_ADD_FAILED", "Configs repo");
result = new HttpLocalizedOperationResult();
cruiseConfig = new GoConfigMother().defaultCruiseConfig();
configRepo = new ConfigRepoConfig(new GitMaterialConfig("https://foo.git", "master"), "json-plugin", repoId);
}
use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class CreatePackageConfigCommandTest method setup.
@Before
public void setup() throws Exception {
initMocks(this);
currentUser = new Username(new CaseInsensitiveString("user"));
result = new HttpLocalizedOperationResult();
cruiseConfig = new GoConfigMother().defaultCruiseConfig();
packageId = "prettyjson";
packageUuid = "random-uuid";
configuration = new Configuration(new ConfigurationProperty(new ConfigurationKey("PACKAGE_ID"), new ConfigurationValue(packageId)));
packageDefinition = new PackageDefinition(packageUuid, "prettyjson", configuration);
PackageRepositories repositories = cruiseConfig.getPackageRepositories();
repoId = "repoId";
Configuration configuration = new Configuration(new ConfigurationProperty(new ConfigurationKey("foo"), new ConfigurationValue("bar")));
PluginConfiguration pluginConfiguration = new PluginConfiguration("plugin-id", "1");
repository = new PackageRepository(repoId, "repoName", pluginConfiguration, configuration);
repositories.add(repository);
cruiseConfig.setPackageRepositories(repositories);
}
use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class DeleteConfigRepoCommandTest method setup.
@Before
public void setup() throws Exception {
initMocks(this);
currentUser = new Username(new CaseInsensitiveString("user"));
cruiseConfig = new GoConfigMother().defaultCruiseConfig();
repoId = "repo-1";
configRepo = new ConfigRepoConfig(new GitMaterialConfig("http://foo.git", "master"), "plugin-id", repoId);
result = new HttpLocalizedOperationResult();
cruiseConfig.getConfigRepos().add(configRepo);
}
use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class DeletePackageRepositoryCommandTest method setup.
@Before
public void setup() throws Exception {
initMocks(this);
currentUser = new Username(new CaseInsensitiveString("user"));
cruiseConfig = new GoConfigMother().defaultCruiseConfig();
packageRepository = new PackageRepository();
repoId = "npm";
packageRepository.setId(repoId);
result = new HttpLocalizedOperationResult();
cruiseConfig.setPackageRepositories(new PackageRepositories(packageRepository));
}
use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class DeleteTemplateConfigCommandTest method setup.
@Before
public void setup() {
initMocks(this);
currentUser = new Username(new CaseInsensitiveString("user"));
cruiseConfig = new GoConfigMother().defaultCruiseConfig();
pipelineTemplateConfig = new PipelineTemplateConfig(new CaseInsensitiveString("template"), StageConfigMother.oneBuildPlanWithResourcesAndMaterials("stage", "job"));
result = new HttpLocalizedOperationResult();
}
Aggregations