public List<Project> getUsedIn() { if (associatedProjects == null) { ProjectIssueTypeSchemeHelper helper = componentFactory.createObject(ProjectIssueTypeSchemeHelper.class); associatedProjects = helper.getProjectsUsingScheme(getConfigScheme()); } return associatedProjects; }
private void setupMockManagers() { mockUpgradeManager = createStrictMock(UpgradeManager.class); mockConsistencyChecker = createStrictMock(ConsistencyChecker.class); mockMailQueue = createStrictMock(MailQueue.class); mockScheduler = createStrictMock(Scheduler.class); mockIndexManager = createStrictMock(IndexLifecycleManager.class); mockIndexPathManager = createStrictMock(IndexPathManager.class); mockAttachmentPathManager = createStrictMock(AttachmentPathManager.class); mockExternalLinkUtil = createMock(ExternalLinkUtil.class); mockJiraLicenseService = createStrictMock(JiraLicenseUpdaterService.class); mockLicenseStringFactory = createStrictMock(LicenseStringFactory.class); mockBuildUtilsInfo = createStrictMock(BuildUtilsInfo.class); mockBeanFactory = createStrictMock(I18nHelper.BeanFactory.class); mockI18nHelper = createStrictMock(I18nHelper.class); mockPermissionManager = createStrictMock(PermissionManager.class); mockJiraHome = createStrictMock(JiraHome.class); mockOfBizDelegator = createMock(OfBizDelegator.class); mockTaskManager = createStrictMock(TaskManager.class); mockModelReader = createStrictMock(ModelReader.class); mockProperties = new MockApplicationProperties(); mockPluginEventManager = createStrictMock(PluginEventManager.class); mockFactory = createNiceMock(ComponentFactory.class); mockValidationResult = createMock(JiraLicenseService.ValidationResult.class); mockDependencies = new MockDataImportDependencies( mockConsistencyChecker, mockPluginEventManager, pluginUpgradeManager); mockBarrier = createMock(DirectorySynchroniserBarrier.class); backup = createStrictMock(Backup.class); eventPublisher = createStrictMock(EventPublisher.class); // These are deps that will come from pico via the MockDataImportDependencies class above. addMock(Scheduler.class, mockScheduler); addMock(OfBizDelegator.class, mockOfBizDelegator); addMock(ConsistencyChecker.class, mockConsistencyChecker); addMock(UpgradeManager.class, mockUpgradeManager); addMock(IndexLifecycleManager.class, mockIndexManager); expect(mockFactory.createObject(DirectorySynchroniserBarrier.class)).andStubReturn(mockBarrier); }