diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/plugin.ts b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/plugin.ts index 063aa8f7fa13a..e5ef459b6f5fd 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/plugin.ts +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/server/plugin.ts @@ -13,16 +13,18 @@ import { IKibanaResponse, } from 'kibana/server'; import { schema } from '@kbn/config-schema'; -import { EncryptedSavedObjectsPluginSetup } from '../../../../../../../plugins/encrypted_saved_objects/server'; +import { EncryptedSavedObjectsPluginStart } from '../../../../../../../plugins/encrypted_saved_objects/server'; import { SpacesPluginSetup } from '../../../../../../../plugins/spaces/server'; interface FixtureSetupDeps { spaces?: SpacesPluginSetup; - encryptedSavedObjects: EncryptedSavedObjectsPluginSetup; +} +interface FixtureStartDeps { + encryptedSavedObjects: EncryptedSavedObjectsPluginStart; } -export class FixturePlugin implements Plugin { - public setup(core: CoreSetup, { spaces, encryptedSavedObjects }: FixtureSetupDeps) { +export class FixturePlugin implements Plugin { + public setup(core: CoreSetup, { spaces }: FixtureSetupDeps) { core.http.createRouter().post( { path: '/api/check_aad', @@ -41,12 +43,10 @@ export class FixturePlugin implements Plugin { ): Promise> { try { let namespace: string | undefined; - const encryptedSavedObjectsWithAlert = encryptedSavedObjects.startWithHiddenTypes([ - 'alert', - ]); if (spaces && req.body.spaceId) { namespace = spaces.spacesService.spaceIdToNamespace(req.body.spaceId); } + const [, { encryptedSavedObjects }] = await core.getStartServices(); await encryptedSavedObjects .getClient(['alert']) .getDecryptedAsInternalUser(req.body.type, req.body.id, {