Search in sources :

Example 11 with GoConfigService

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

the class SecurityAuthConfigCommandTest method setUp.

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

Example 12 with GoConfigService

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

the class PluginProfileCommandTest 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 13 with GoConfigService

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

the class RoleConfigCommandTest method setUp.

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

Example 14 with GoConfigService

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

the class EmailNotificationListenerTest method setUp.

@Before
public void setUp() throws Exception {
    context = new ClassMockery();
    goConfigService = context.mock(GoConfigService.class);
    goMailSenderFactory = context.mock(EmailNotificationListener.GoMailSenderFactory.class);
    emailNotificationListener = new EmailNotificationListener(goConfigService, goMailSenderFactory);
}
Also used : ClassMockery(com.thoughtworks.go.util.ClassMockery) GoConfigService(com.thoughtworks.go.server.service.GoConfigService) Before(org.junit.Before)

Example 15 with GoConfigService

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

the class MaterialUpdateServiceTest method setUp.

@Before
public void setUp() throws Exception {
    queue = mock(MaterialUpdateQueue.class);
    configQueue = mock(ConfigMaterialUpdateQueue.class);
    watchList = mock(GoConfigWatchList.class);
    completed = mock(MaterialUpdateCompletedTopic.class);
    goConfigService = mock(GoConfigService.class);
    postCommitHookMaterialType = mock(PostCommitHookMaterialTypeResolver.class);
    serverHealthService = mock(ServerHealthService.class);
    systemEnvironment = new SystemEnvironment();
    scmMaterialSource = mock(SCMMaterialSource.class);
    dependencyMaterialUpdateNotifier = mock(DependencyMaterialUpdateNotifier.class);
    materialConfigConverter = mock(MaterialConfigConverter.class);
    MDUPerformanceLogger mduPerformanceLogger = mock(MDUPerformanceLogger.class);
    dependencyMaterialUpdateQueue = mock(DependencyMaterialUpdateQueue.class);
    service = new MaterialUpdateService(queue, configQueue, completed, watchList, goConfigService, systemEnvironment, serverHealthService, postCommitHookMaterialType, mduPerformanceLogger, materialConfigConverter, dependencyMaterialUpdateQueue);
    service.registerMaterialSources(scmMaterialSource);
    service.registerMaterialUpdateCompleteListener(scmMaterialSource);
    service.registerMaterialUpdateCompleteListener(dependencyMaterialUpdateNotifier);
    HashSet<MaterialConfig> materialConfigs = new HashSet(Collections.singleton(MATERIAL_CONFIG));
    HashSet<Material> materials = new HashSet(Collections.singleton(svnMaterial));
    when(goConfigService.getSchedulableMaterials()).thenReturn(materialConfigs);
    when(materialConfigConverter.toMaterials(materialConfigs)).thenReturn(materials);
    username = new Username(new CaseInsensitiveString("loser"));
    result = new HttpLocalizedOperationResult();
    validMaterialType = mock(PostCommitHookMaterialType.class);
    when(validMaterialType.isKnown()).thenReturn(true);
    when(validMaterialType.isValid(anyString())).thenReturn(true);
    invalidMaterialType = mock(PostCommitHookMaterialType.class);
    when(invalidMaterialType.isKnown()).thenReturn(false);
    when(invalidMaterialType.isValid(anyString())).thenReturn(false);
}
Also used : MDUPerformanceLogger(com.thoughtworks.go.server.perf.MDUPerformanceLogger) Material(com.thoughtworks.go.domain.materials.Material) DependencyMaterial(com.thoughtworks.go.config.materials.dependency.DependencyMaterial) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) ScmMaterial(com.thoughtworks.go.config.materials.ScmMaterial) MaterialConfigConverter(com.thoughtworks.go.server.service.MaterialConfigConverter) GoConfigService(com.thoughtworks.go.server.service.GoConfigService) SystemEnvironment(com.thoughtworks.go.util.SystemEnvironment) HttpLocalizedOperationResult(com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult) Username(com.thoughtworks.go.server.domain.Username) MaterialConfig(com.thoughtworks.go.domain.materials.MaterialConfig) SvnMaterialConfig(com.thoughtworks.go.config.materials.svn.SvnMaterialConfig) PostCommitHookMaterialTypeResolver(com.thoughtworks.go.server.materials.postcommit.PostCommitHookMaterialTypeResolver) PostCommitHookMaterialType(com.thoughtworks.go.server.materials.postcommit.PostCommitHookMaterialType) 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