Search in sources :

Example 6 with GoConfigService

use of com.thoughtworks.go.server.service.GoConfigService in project gocd by gocd.

the class RoleConfigUpdateCommandTest method setUp.

@Before
public void setUp() throws Exception {
    currentUser = new Username("bob");
    goConfigService = mock(GoConfigService.class);
    cruiseConfig = GoConfigMother.defaultCruiseConfig();
}
Also used : Username(com.thoughtworks.go.server.domain.Username) GoConfigService(com.thoughtworks.go.server.service.GoConfigService) Before(org.junit.Before)

Example 7 with GoConfigService

use of com.thoughtworks.go.server.service.GoConfigService in project gocd by gocd.

the class GoPartialConfigTest method setUp.

@Before
public void setUp() {
    serverHealthService = mock(ServerHealthService.class);
    configPluginService = mock(GoConfigPluginService.class);
    plugin = mock(PartialConfigProvider.class);
    when(configPluginService.partialConfigProviderFor(any(ConfigRepoConfig.class))).thenReturn(plugin);
    cruiseConfig = new BasicCruiseConfig();
    configRepoConfig = new ConfigRepoConfig(new GitMaterialConfig("url"), "plugin");
    cruiseConfig.setConfigRepos(new ConfigReposConfig(configRepoConfig));
    cachedGoConfig = mock(CachedGoConfig.class);
    when(cachedGoConfig.currentConfig()).thenReturn(cruiseConfig);
    configWatchList = new GoConfigWatchList(cachedGoConfig);
    repoConfigDataSource = new GoRepoConfigDataSource(configWatchList, configPluginService, serverHealthService);
    cachedGoPartials = new CachedGoPartials(serverHealthService);
    goConfigService = mock(GoConfigService.class);
    serverHealthService = mock(ServerHealthService.class);
    partialConfig = new GoPartialConfig(repoConfigDataSource, configWatchList, goConfigService, cachedGoPartials, serverHealthService);
}
Also used : ConfigRepoConfig(com.thoughtworks.go.config.remote.ConfigRepoConfig) GoConfigService(com.thoughtworks.go.server.service.GoConfigService) ConfigReposConfig(com.thoughtworks.go.config.remote.ConfigReposConfig) GitMaterialConfig(com.thoughtworks.go.config.materials.git.GitMaterialConfig) ServerHealthService(com.thoughtworks.go.serverhealth.ServerHealthService) Before(org.junit.Before)

Example 8 with GoConfigService

use of com.thoughtworks.go.server.service.GoConfigService in project gocd by gocd.

the class LdapUserSearchTest method setUp.

@Before
public void setUp() {
    goConfigService = mock(GoConfigService.class);
    contextFactory = mock(SpringSecurityContextSource.class);
    securityConfig = mock(SecurityConfig.class);
    ldapTemplate = mock(LdapTemplate.class);
    logger = mock(Logger.class);
    ldapUserSearch = new LdapUserSearch(goConfigService, contextFactory, ldapTemplate, logger);
    when(goConfigService.security()).thenReturn(securityConfig);
    spy = spy(ldapUserSearch);
}
Also used : SpringSecurityContextSource(org.springframework.security.ldap.SpringSecurityContextSource) SecurityConfig(com.thoughtworks.go.config.SecurityConfig) FilterBasedLdapUserSearch(org.springframework.security.ldap.search.FilterBasedLdapUserSearch) Logger(org.apache.log4j.Logger) LdapTemplate(org.springframework.ldap.core.LdapTemplate) GoConfigService(com.thoughtworks.go.server.service.GoConfigService) Before(org.junit.Before)

Example 9 with GoConfigService

use of com.thoughtworks.go.server.service.GoConfigService in project gocd by gocd.

the class AgentsEntityConfigUpdateCommandTest method setUp.

@Before
public void setUp() throws Exception {
    result = new HttpLocalizedOperationResult();
    currentUser = new Username(new CaseInsensitiveString("user"));
    cruiseConfig = new GoConfigMother().defaultCruiseConfig();
    goConfigService = mock(GoConfigService.class);
    agentInstances = mock(AgentInstances.class);
    uuids = new ArrayList<>();
    environmentsToAdd = new ArrayList<>();
    environmentsToRemove = new ArrayList<>();
    resourcesToAdd = new ArrayList<>();
    resourcesToRemove = new ArrayList<>();
    triState = TriState.TRUE;
    when(goConfigService.getEnvironments()).thenReturn(cruiseConfig.getEnvironments());
}
Also used : HttpLocalizedOperationResult(com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult) AgentInstances(com.thoughtworks.go.server.domain.AgentInstances) Username(com.thoughtworks.go.server.domain.Username) CaseInsensitiveString(com.thoughtworks.go.config.CaseInsensitiveString) GoConfigService(com.thoughtworks.go.server.service.GoConfigService) GoConfigMother(com.thoughtworks.go.helper.GoConfigMother) Before(org.junit.Before)

Example 10 with GoConfigService

use of com.thoughtworks.go.server.service.GoConfigService in project gocd by gocd.

the class ElasticAgentProfileUpdateCommandTest method setUp.

@Before
public void setUp() throws Exception {
    currentUser = new Username("bob");
    goConfigService = mock(GoConfigService.class);
    cruiseConfig = GoConfigMother.defaultCruiseConfig();
}
Also used : Username(com.thoughtworks.go.server.domain.Username) GoConfigService(com.thoughtworks.go.server.service.GoConfigService) Before(org.junit.Before)

Aggregations

GoConfigService (com.thoughtworks.go.server.service.GoConfigService)16 Before (org.junit.Before)13 Username (com.thoughtworks.go.server.domain.Username)8 ServerHealthService (com.thoughtworks.go.serverhealth.ServerHealthService)3 Test (org.junit.Test)3 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)2 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)2 SvnMaterialConfig (com.thoughtworks.go.config.materials.svn.SvnMaterialConfig)2 AuthorizationExtension (com.thoughtworks.go.plugin.access.authorization.AuthorizationExtension)2 MaterialConfigConverter (com.thoughtworks.go.server.service.MaterialConfigConverter)2 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)2 SystemEnvironment (com.thoughtworks.go.util.SystemEnvironment)2 CachedGoPartials (com.thoughtworks.go.config.CachedGoPartials)1 GoConfigMigration (com.thoughtworks.go.config.GoConfigMigration)1 SecurityConfig (com.thoughtworks.go.config.SecurityConfig)1 ScmMaterial (com.thoughtworks.go.config.materials.ScmMaterial)1 DependencyMaterial (com.thoughtworks.go.config.materials.dependency.DependencyMaterial)1 GitMaterialConfig (com.thoughtworks.go.config.materials.git.GitMaterialConfig)1 HgMaterial (com.thoughtworks.go.config.materials.mercurial.HgMaterial)1 HgMaterialConfig (com.thoughtworks.go.config.materials.mercurial.HgMaterialConfig)1