From 86aa24e198bb95d8e5592831469bd4edddc6bc50 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Sat, 6 Feb 2021 15:01:16 -0800 Subject: [PATCH] Fix service dependency startup warning (#14180) * Fix service dependency startup warning * fix tests --- .../test/common/instantiationServiceMock.ts | 33 ++++++++++++ .../notebookEditorModel.test.ts | 2 - .../test/browser/serverTreeView.test.ts | 2 - .../query/test/browser/queryEditor.test.ts | 4 -- .../browser/accountManagementService.ts | 10 ++-- .../browser/accountManagementService.test.ts | 9 ++-- .../browser/connectionManagementService.ts | 20 +++---- .../browser/connectionDialogService.test.ts | 2 - .../browser/connectionDialogWidget.test.ts | 2 - .../connectionManagementService.test.ts | 52 ++++++++++++++----- .../browser/insightsDialogController.test.ts | 2 - .../asyncServerTreeDragAndDrop.test.ts | 2 - .../browser/dragAndDropController.test.ts | 2 - 13 files changed, 84 insertions(+), 58 deletions(-) create mode 100644 src/sql/platform/instantiation/test/common/instantiationServiceMock.ts diff --git a/src/sql/platform/instantiation/test/common/instantiationServiceMock.ts b/src/sql/platform/instantiation/test/common/instantiationServiceMock.ts new file mode 100644 index 0000000000..8029bc9189 --- /dev/null +++ b/src/sql/platform/instantiation/test/common/instantiationServiceMock.ts @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the Source EULA. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; +import { TestInstantiationService as VsTestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; + +/** + * An extension of the VS TestInstantiationService which allows for stubbing out createInstance calls + * as well as services. + */ +export class TestInstantiationService extends VsTestInstantiationService { + + private _createInstanceStubsMap: Map, any> = new Map, any>(); + + /** + * Adds a stub for a ctor or descriptor which is then returned when createInstance is called + * for that ctor or descriptor. + * @param ctorOrDescriptor The ctor or descriptor to stub out + * @param obj The object to return instead when createInstance is invoked + */ + public stubCreateInstance(ctorOrDescriptor: any | SyncDescriptor, obj: any): void { + this._createInstanceStubsMap.set(ctorOrDescriptor, obj); + } + + createInstance(ctorOrDescriptor: any | SyncDescriptor, ...rest: any[]): any { + if (this._createInstanceStubsMap.has(ctorOrDescriptor)) { + return this._createInstanceStubsMap.get(ctorOrDescriptor); + } + return super.createInstance(ctorOrDescriptor, ...rest); + } +} diff --git a/src/sql/workbench/contrib/notebook/test/electron-browser/notebookEditorModel.test.ts b/src/sql/workbench/contrib/notebook/test/electron-browser/notebookEditorModel.test.ts index f7a7a68f0c..29dcfdfa74 100644 --- a/src/sql/workbench/contrib/notebook/test/electron-browser/notebookEditorModel.test.ts +++ b/src/sql/workbench/contrib/notebook/test/electron-browser/notebookEditorModel.test.ts @@ -77,8 +77,6 @@ suite('Notebook Editor Model', function (): void { testinstantiationService.stub(IStorageService, new TestStorageService()); testinstantiationService.stub(IProductService, { quality: 'stable' }); const queryConnectionService = TypeMoq.Mock.ofType(ConnectionManagementService, TypeMoq.MockBehavior.Loose, - undefined, // connection store - undefined, // connection status manager undefined, // connection dialog service testinstantiationService, // instantiation service undefined, // editor service diff --git a/src/sql/workbench/contrib/objectExplorer/test/browser/serverTreeView.test.ts b/src/sql/workbench/contrib/objectExplorer/test/browser/serverTreeView.test.ts index 40a070e2f7..2e5034b0ec 100644 --- a/src/sql/workbench/contrib/objectExplorer/test/browser/serverTreeView.test.ts +++ b/src/sql/workbench/contrib/objectExplorer/test/browser/serverTreeView.test.ts @@ -28,8 +28,6 @@ suite('ServerTreeView onAddConnectionProfile handler tests', () => { let instantiationService = new TestInstantiationService(); instantiationService.stub(IStorageService, new TestStorageService()); let mockConnectionManagementService = TypeMoq.Mock.ofType(ConnectionManagementService, TypeMoq.MockBehavior.Strict, - undefined, //connection store - undefined, // connectionstatusmanager undefined, // connectiondialog service instantiationService, // instantiation service undefined, // editor service diff --git a/src/sql/workbench/contrib/query/test/browser/queryEditor.test.ts b/src/sql/workbench/contrib/query/test/browser/queryEditor.test.ts index 4a565a7691..0b72ce23cc 100644 --- a/src/sql/workbench/contrib/query/test/browser/queryEditor.test.ts +++ b/src/sql/workbench/contrib/query/test/browser/queryEditor.test.ts @@ -93,8 +93,6 @@ suite('SQL QueryEditor Tests', () => { let testinstantiationService = new TestInstantiationService(); testinstantiationService.stub(IStorageService, new TestStorageService()); connectionManagementService = TypeMoq.Mock.ofType(ConnectionManagementService, TypeMoq.MockBehavior.Loose, - undefined, // connection store - undefined, // connection status manager undefined, // connection dialog service testinstantiationService, // instantiation service undefined, // editor service @@ -267,8 +265,6 @@ suite('SQL QueryEditor Tests', () => { let testinstantiationService = new TestInstantiationService(); testinstantiationService.stub(IStorageService, new TestStorageService()); connectionManagementService = TypeMoq.Mock.ofType(ConnectionManagementService, TypeMoq.MockBehavior.Loose, - undefined, // connection store - undefined, // connection status manager undefined, // connection dialog service testinstantiationService, // instantiation service undefined, // editor service diff --git a/src/sql/workbench/services/accountManagement/browser/accountManagementService.ts b/src/sql/workbench/services/accountManagement/browser/accountManagementService.ts index 0c7e281b1b..91a823ba1a 100644 --- a/src/sql/workbench/services/accountManagement/browser/accountManagementService.ts +++ b/src/sql/workbench/services/accountManagement/browser/accountManagementService.ts @@ -50,7 +50,6 @@ export class AccountManagementService implements IAccountManagementService { // CONSTRUCTOR ///////////////////////////////////////////////////////// constructor( - private _mementoObj: object, @IInstantiationService private _instantiationService: IInstantiationService, @IStorageService private _storageService: IStorageService, @IClipboardService private _clipboardService: IClipboardService, @@ -58,12 +57,9 @@ export class AccountManagementService implements IAccountManagementService { @ILogService private readonly _logService: ILogService, @INotificationService private readonly _notificationService: INotificationService ) { - // Create the account store - if (!this._mementoObj) { - this._mementoContext = new Memento(AccountManagementService.ACCOUNT_MEMENTO, this._storageService); - this._mementoObj = this._mementoContext.getMemento(StorageScope.GLOBAL); - } - this._accountStore = this._instantiationService.createInstance(AccountStore, this._mementoObj); + this._mementoContext = new Memento(AccountManagementService.ACCOUNT_MEMENTO, this._storageService); + const mementoObj = this._mementoContext.getMemento(StorageScope.GLOBAL); + this._accountStore = this._instantiationService.createInstance(AccountStore, mementoObj); // Setup the event emitters this._addAccountProviderEmitter = new Emitter(); diff --git a/src/sql/workbench/services/accountManagement/test/browser/accountManagementService.test.ts b/src/sql/workbench/services/accountManagement/test/browser/accountManagementService.test.ts index 66aa82f257..c155bebf27 100644 --- a/src/sql/workbench/services/accountManagement/test/browser/accountManagementService.test.ts +++ b/src/sql/workbench/services/accountManagement/test/browser/accountManagementService.test.ts @@ -214,7 +214,7 @@ suite('Account Management Service Tests:', () => { // If: I add an account when the provider doesn't exist // Then: It should not resolve return Promise.race([ - new Promise((resolve, reject) => setTimeout(() => resolve(), 100)), + new Promise((resolve, reject) => setTimeout(() => resolve(), 100)), ams.addAccount('doesNotExist').then(() => { throw new Error('Promise resolved when the provider did not exist'); }) ]); }); @@ -283,7 +283,7 @@ suite('Account Management Service Tests:', () => { // If: I get accounts when the provider doesn't exist // Then: It should not resolve return Promise.race([ - new Promise((resolve, reject) => setTimeout(() => resolve(), 100)), + new Promise((resolve, reject) => setTimeout(() => resolve(), 100)), ams.getAccountsForProvider('doesNotExist').then(() => { throw new Error('Promise resolved when the provider did not exist'); }) ]); }); @@ -529,13 +529,10 @@ function getTestState(): AccountManagementState { mockInstantiationService.setup(x => x.createInstance(TypeMoq.It.isValue(AccountStore), TypeMoq.It.isAny())) .returns(() => mockAccountStore.object); - // Create mock memento - let mockMemento = {}; - const testNotificationService = new TestNotificationService(); // Create the account management service - let ams = new AccountManagementService(mockMemento, mockInstantiationService.object, new TestStorageService(), undefined!, undefined!, undefined!, testNotificationService); + let ams = new AccountManagementService(mockInstantiationService.object, new TestStorageService(), undefined!, undefined!, undefined!, testNotificationService); // Wire up event handlers let evUpdate = new EventVerifierSingle(); diff --git a/src/sql/workbench/services/connection/browser/connectionManagementService.ts b/src/sql/workbench/services/connection/browser/connectionManagementService.ts index 341cf1bbc5..e5d4f19b14 100644 --- a/src/sql/workbench/services/connection/browser/connectionManagementService.ts +++ b/src/sql/workbench/services/connection/browser/connectionManagementService.ts @@ -41,8 +41,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { ILogService } from 'vs/platform/log/common/log'; import * as interfaces from 'sql/platform/connection/common/interfaces'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { Memento } from 'vs/workbench/common/memento'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { Memento, MementoObject } from 'vs/workbench/common/memento'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { entries } from 'sql/base/common/collections'; import { values } from 'vs/base/common/collections'; @@ -70,14 +69,15 @@ export class ConnectionManagementService extends Disposable implements IConnecti private _connectionGlobalStatus = new ConnectionGlobalStatus(this._notificationService); private _mementoContext: Memento; - private _mementoObj: any; + private _mementoObj: MementoObject; + private _connectionStore: ConnectionStore; + private _connectionStatusManager: ConnectionStatusManager; + private static readonly CONNECTION_MEMENTO = 'ConnectionManagement'; private static readonly _azureResources: AzureResource[] = [AzureResource.ResourceManagement, AzureResource.Sql, AzureResource.OssRdbms]; constructor( - private _connectionStore: ConnectionStore, - private _connectionStatusManager: ConnectionStatusManager, @IConnectionDialogService private _connectionDialogService: IConnectionDialogService, @IInstantiationService private _instantiationService: IInstantiationService, @IEditorService private _editorService: IEditorService, @@ -91,18 +91,12 @@ export class ConnectionManagementService extends Disposable implements IConnecti @IAccountManagementService private _accountManagementService: IAccountManagementService, @ILogService private _logService: ILogService, @IStorageService private _storageService: IStorageService, - @IEnvironmentService private _environmentService: IEnvironmentService, @IExtensionService private readonly extensionService: IExtensionService ) { super(); - if (!this._connectionStore) { - this._connectionStore = _instantiationService.createInstance(ConnectionStore); - } - if (!this._connectionStatusManager) { - this._connectionStatusManager = new ConnectionStatusManager(this._capabilitiesService, this._logService, this._environmentService, this._notificationService); - } - + this._connectionStore = _instantiationService.createInstance(ConnectionStore); + this._connectionStatusManager = _instantiationService.createInstance(ConnectionStatusManager); if (this._storageService) { this._mementoContext = new Memento(ConnectionManagementService.CONNECTION_MEMENTO, this._storageService); this._mementoObj = this._mementoContext.getMemento(StorageScope.GLOBAL); diff --git a/src/sql/workbench/services/connection/test/browser/connectionDialogService.test.ts b/src/sql/workbench/services/connection/test/browser/connectionDialogService.test.ts index 11fcf46d67..7503482e17 100644 --- a/src/sql/workbench/services/connection/test/browser/connectionDialogService.test.ts +++ b/src/sql/workbench/services/connection/test/browser/connectionDialogService.test.ts @@ -90,8 +90,6 @@ suite('ConnectionDialogService tests', () => { let errorMessageService = getMockErrorMessageService(); let capabilitiesService = new TestCapabilitiesService(); mockConnectionManagementService = TypeMoq.Mock.ofType(ConnectionManagementService, TypeMoq.MockBehavior.Strict, - undefined, // connection store - undefined, // connection status manager undefined, // connection dialog service testInstantiationService, // instantiation service undefined, // editor service diff --git a/src/sql/workbench/services/connection/test/browser/connectionDialogWidget.test.ts b/src/sql/workbench/services/connection/test/browser/connectionDialogWidget.test.ts index c166e0793f..e98e2d9a38 100644 --- a/src/sql/workbench/services/connection/test/browser/connectionDialogWidget.test.ts +++ b/src/sql/workbench/services/connection/test/browser/connectionDialogWidget.test.ts @@ -57,8 +57,6 @@ suite('ConnectionDialogWidget tests', () => { cmInstantiationService.stub(IContextKeyService, new MockContextKeyService()); mockConnectionManagementService = TypeMoq.Mock.ofType(ConnectionManagementService, TypeMoq.MockBehavior.Strict, - undefined, // connection store - undefined, // connection status manager undefined, // connection dialog service cmInstantiationService, // instantiation service undefined, // editor service diff --git a/src/sql/workbench/services/connection/test/browser/connectionManagementService.test.ts b/src/sql/workbench/services/connection/test/browser/connectionManagementService.test.ts index 740f617790..63b8a1c2b2 100644 --- a/src/sql/workbench/services/connection/test/browser/connectionManagementService.test.ts +++ b/src/sql/workbench/services/connection/test/browser/connectionManagementService.test.ts @@ -25,18 +25,22 @@ import * as azdata from 'azdata'; import * as assert from 'assert'; import * as TypeMoq from 'typemoq'; +import * as sinon from 'sinon'; import { IConnectionProfileGroup, ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup'; import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile'; import { TestAccountManagementService } from 'sql/platform/accounts/test/common/testAccountManagementService'; import { TestEnvironmentService, TestEditorService } from 'vs/workbench/test/browser/workbenchTestServices'; import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; -import { NullLogService } from 'vs/platform/log/common/log'; +import { ILogService, NullLogService } from 'vs/platform/log/common/log'; import { assign } from 'vs/base/common/objects'; import { NullAdsTelemetryService } from 'sql/platform/telemetry/common/adsTelemetryService'; import { TestStorageService } from 'vs/workbench/test/common/workbenchTestServices'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IQueryEditorConfiguration } from 'sql/platform/query/common/query'; +import { TestInstantiationService } from 'sql/platform/instantiation/test/common/instantiationServiceMock'; +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService'; suite('SQL ConnectionManagementService tests', () => { @@ -156,11 +160,16 @@ suite('SQL ConnectionManagementService tests', () => { }); function createConnectionManagementService(): ConnectionManagementService { + const testInstantiationService = new TestInstantiationService(); + const testLogService = new NullLogService(); + testInstantiationService.stub(IStorageService, new TestStorageService()); + testInstantiationService.stub(ICapabilitiesService, capabilitiesService); + testInstantiationService.stub(ILogService, testLogService); + testInstantiationService.stubCreateInstance(ConnectionStore, connectionStore.object); + let connectionManagementService = new ConnectionManagementService( - connectionStore.object, - undefined, connectionDialogService.object, - undefined, // IInstantiationService + testInstantiationService, workbenchEditorService.object, new NullAdsTelemetryService(), // ITelemetryService workspaceConfigurationServiceMock.object, @@ -170,9 +179,8 @@ suite('SQL ConnectionManagementService tests', () => { resourceProviderStubMock.object, undefined, // IAngularEventingService accountManagementService.object, - new NullLogService(), // ILogService + testLogService, // ILogService undefined, // IStorageService - TestEnvironmentService, getBasicExtensionService() ); return connectionManagementService; @@ -1556,7 +1564,10 @@ suite('SQL ConnectionManagementService tests', () => { profile.password = test_password; return { profile: profile, savedCred: true }; }); - const connectionManagementService = new ConnectionManagementService(connectionStoreMock.object, undefined, undefined, undefined, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService()); + const testInstantiationService = new TestInstantiationService(); + testInstantiationService.stub(IStorageService, new TestStorageService()); + testInstantiationService.stubCreateInstance(ConnectionStore, connectionStoreMock.object); + const connectionManagementService = new ConnectionManagementService(undefined, testInstantiationService, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService()); assert.equal(profile.password, '', 'Profile should not have password initially'); assert.equal(profile.options['password'], '', 'Profile options should not have password initially'); // Check for invalid profile id @@ -1582,7 +1593,11 @@ suite('SQL ConnectionManagementService tests', () => { profile.password = test_password; return { profile: profile, savedCred: true }; }); - const connectionManagementService = new ConnectionManagementService(connectionStoreMock.object, undefined, undefined, undefined, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService()); + const testInstantiationService = new TestInstantiationService(); + testInstantiationService.stub(IStorageService, new TestStorageService()); + testInstantiationService.stubCreateInstance(ConnectionStore, connectionStoreMock.object); + + const connectionManagementService = new ConnectionManagementService(undefined, testInstantiationService, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService()); assert.equal(profile.password, '', 'Profile should not have password initially'); assert.equal(profile.options['password'], '', 'Profile options should not have password initially'); let credentials = await connectionManagementService.getConnectionCredentials(profile.id); @@ -1734,7 +1749,6 @@ suite('SQL ConnectionManagementService tests', () => { test('getConnections test', () => { const connectionStatusManagerMock = TypeMoq.Mock.ofType(ConnectionStatusManager, TypeMoq.MockBehavior.Loose); const connectionStoreMock = TypeMoq.Mock.ofType(ConnectionStore, TypeMoq.MockBehavior.Loose, new TestStorageService()); - connectionStatusManagerMock.setup(x => x.getActiveConnectionProfiles(undefined)).returns(() => { return [createConnectionProfile('1'), createConnectionProfile('2')]; }); @@ -1750,7 +1764,13 @@ suite('SQL ConnectionManagementService tests', () => { connectionStoreMock.setup(x => x.getConnectionProfileGroups(TypeMoq.It.isAny(), undefined)).returns(() => { return [group1]; }); - const connectionManagementService = new ConnectionManagementService(connectionStoreMock.object, connectionStatusManagerMock.object, undefined, undefined, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService()); + + const testInstantiationService = new TestInstantiationService(); + const createInstanceStub = sinon.stub(testInstantiationService, 'createInstance'); + createInstanceStub.withArgs(ConnectionStore).returns(connectionStoreMock.object); + createInstanceStub.withArgs(ConnectionStatusManager).returns(connectionStatusManagerMock.object); + + const connectionManagementService = new ConnectionManagementService(undefined, testInstantiationService, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService()); // dupe connections have been seeded the numbers below already reflected the de-duped results @@ -1774,20 +1794,21 @@ suite('SQL ConnectionManagementService tests', () => { }); test('isRecent should evaluate whether a profile was recently connected or not', () => { - const connectionStatusManagerMock = TypeMoq.Mock.ofType(ConnectionStatusManager, TypeMoq.MockBehavior.Loose); const connectionStoreMock = TypeMoq.Mock.ofType(ConnectionStore, TypeMoq.MockBehavior.Loose, new TestStorageService()); + const testInstantiationService = new TestInstantiationService(); + testInstantiationService.stub(IStorageService, new TestStorageService()); + sinon.stub(testInstantiationService, 'createInstance').withArgs(ConnectionStore).returns(connectionStoreMock.object); connectionStoreMock.setup(x => x.getRecentlyUsedConnections()).returns(() => { return [createConnectionProfile('1')]; }); let profile1 = createConnectionProfile('1'); let profile2 = createConnectionProfile('2'); - const connectionManagementService = new ConnectionManagementService(connectionStoreMock.object, connectionStatusManagerMock.object, undefined, undefined, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService()); + const connectionManagementService = new ConnectionManagementService(undefined, testInstantiationService, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService()); assert(connectionManagementService.isRecent(profile1)); assert(!connectionManagementService.isRecent(profile2)); }); test('clearRecentConnection and ConnectionsList should call connectionStore functions', () => { - const connectionStatusManagerMock = TypeMoq.Mock.ofType(ConnectionStatusManager, TypeMoq.MockBehavior.Loose); const connectionStoreMock = TypeMoq.Mock.ofType(ConnectionStore, TypeMoq.MockBehavior.Loose, new TestStorageService()); let called = false; connectionStoreMock.setup(x => x.clearRecentlyUsed()).returns(() => { @@ -1796,8 +1817,11 @@ test('clearRecentConnection and ConnectionsList should call connectionStore func connectionStoreMock.setup(x => x.removeRecentConnection(TypeMoq.It.isAny())).returns(() => { called = true; }); + const testInstantiationService = new TestInstantiationService(); + testInstantiationService.stub(IStorageService, new TestStorageService()); + sinon.stub(testInstantiationService, 'createInstance').withArgs(ConnectionStore).returns(connectionStoreMock.object); let profile1 = createConnectionProfile('1'); - const connectionManagementService = new ConnectionManagementService(connectionStoreMock.object, connectionStatusManagerMock.object, undefined, undefined, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService()); + const connectionManagementService = new ConnectionManagementService(undefined, testInstantiationService, undefined, undefined, undefined, new TestCapabilitiesService(), undefined, undefined, undefined, undefined, undefined, undefined, undefined, getBasicExtensionService()); connectionManagementService.clearRecentConnection(profile1); assert(called); called = false; diff --git a/src/sql/workbench/services/insights/test/browser/insightsDialogController.test.ts b/src/sql/workbench/services/insights/test/browser/insightsDialogController.test.ts index 2ec3fb45f3..dbd79be392 100644 --- a/src/sql/workbench/services/insights/test/browser/insightsDialogController.test.ts +++ b/src/sql/workbench/services/insights/test/browser/insightsDialogController.test.ts @@ -45,8 +45,6 @@ suite('Insights Dialog Controller Tests', () => { let testinstantiationService = new TestInstantiationService(); testinstantiationService.stub(IStorageService, new TestStorageService()); let connMoq = Mock.ofType(ConnectionManagementService, MockBehavior.Strict, - undefined, // connection store - undefined, // connection status manager undefined, // connection dialog service testinstantiationService, // instantiation service undefined, // editor service diff --git a/src/sql/workbench/services/objectExplorer/test/browser/asyncServerTreeDragAndDrop.test.ts b/src/sql/workbench/services/objectExplorer/test/browser/asyncServerTreeDragAndDrop.test.ts index 57e8ef96c7..00094fa409 100644 --- a/src/sql/workbench/services/objectExplorer/test/browser/asyncServerTreeDragAndDrop.test.ts +++ b/src/sql/workbench/services/objectExplorer/test/browser/asyncServerTreeDragAndDrop.test.ts @@ -54,8 +54,6 @@ suite('AsyncServerTreeDragAndDrop', () => { let instantiationService = new TestInstantiationService(); instantiationService.stub(IStorageService, new TestStorageService()); let mockConnectionManagementService = TypeMoq.Mock.ofType(ConnectionManagementService, TypeMoq.MockBehavior.Strict, - undefined, //connection store - undefined, // connectionstatusmanager undefined, // connectiondialog service instantiationService, // instantiation service undefined, // editor service diff --git a/src/sql/workbench/services/objectExplorer/test/browser/dragAndDropController.test.ts b/src/sql/workbench/services/objectExplorer/test/browser/dragAndDropController.test.ts index b0c530a88f..e34af85875 100644 --- a/src/sql/workbench/services/objectExplorer/test/browser/dragAndDropController.test.ts +++ b/src/sql/workbench/services/objectExplorer/test/browser/dragAndDropController.test.ts @@ -59,8 +59,6 @@ suite('SQL Drag And Drop Controller tests', () => { let instantiationService = new TestInstantiationService(); instantiationService.stub(IStorageService, new TestStorageService()); let mockConnectionManagementService = TypeMoq.Mock.ofType(ConnectionManagementService, TypeMoq.MockBehavior.Strict, - undefined, //connection store - undefined, // connectionstatusmanager undefined, // connectiondialog service instantiationService, // instantiation service undefined, // editor service