use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class SCMConfigCommandTest method setup.
@Before
public void setup() throws Exception {
initMocks(this);
currentUser = new Username(new CaseInsensitiveString("user"));
cruiseConfig = new GoConfigMother().defaultCruiseConfig();
scm = new SCM("id", new PluginConfiguration("non-existent-plugin-id", "1"), new Configuration(new ConfigurationProperty(new ConfigurationKey("key"), new ConfigurationValue("value"))));
scms = new SCMs();
scms.add(scm);
}
use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class UpdatePackageConfigCommandTest method setup.
@Before
public void setup() throws Exception {
initMocks(this);
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.
@Before
public void setUp() throws Exception {
initMocks(this);
goConfigMother = new GoConfigMother();
handler = new CcTrayConfigChangeHandler(cache, stageStatusLoader, ccTrayViewAuthority);
}
use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class UpdateEnvironmentCommandTest method setup.
@Before
public void setup() throws Exception {
initMocks(this);
currentUser = new Username(new CaseInsensitiveString("user"));
cruiseConfig = new GoConfigMother().defaultCruiseConfig();
oldEnvironmentName = new CaseInsensitiveString("Dev");
newEnvironmentName = new CaseInsensitiveString("Test");
oldEnvironmentConfig = new BasicEnvironmentConfig(oldEnvironmentName);
newEnvironmentConfig = new BasicEnvironmentConfig(newEnvironmentName);
result = new HttpLocalizedOperationResult();
md5 = "md5";
cruiseConfig.addEnvironment(oldEnvironmentConfig);
actionFailed = LocalizedMessage.string("ENV_UPDATE_FAILED", oldEnvironmentConfig.name());
}
use of com.thoughtworks.go.helper.GoConfigMother in project gocd by gocd.
the class ServerHealthServiceTest method shouldReturnErrorLogs.
@Test
public void shouldReturnErrorLogs() throws Exception {
serverHealthService.update(ServerHealthState.error("message", "description", pipelineId));
CruiseConfig cruiseConfig = new BasicCruiseConfig();
new GoConfigMother().addPipeline(cruiseConfig, PIPELINE_NAME, "stageName", "jon");
assertThat(serverHealthService.getAllValidLogs(cruiseConfig).size(), is(1));
}
Aggregations