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();
}
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();
}
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();
}
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);
}
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);
}
Aggregations