From e2c6d468e49435d900fccbdd86fda96e667f3a0f Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Tue, 9 Jul 2024 14:11:56 +0200 Subject: [PATCH] Chore: use createApiTokenService instead of newing it up (#7560) PR #7519 introduced the pattern of using `createApiTokenService` instead of newing it up. This usage was introduced in a concurrent PR (#7503), so we're just cleaning up and making the usage consistent. --- src/lib/features/project/project-service.e2e.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/features/project/project-service.e2e.test.ts b/src/lib/features/project/project-service.e2e.test.ts index f243d54ada..5dcac8ae1f 100644 --- a/src/lib/features/project/project-service.e2e.test.ts +++ b/src/lib/features/project/project-service.e2e.test.ts @@ -9,7 +9,7 @@ import { RoleName } from '../../types/model'; import { randomId } from '../../util/random-id'; import EnvironmentService from '../project-environments/environment-service'; import IncompatibleProjectError from '../../error/incompatible-project-error'; -import { ApiTokenService, EventService } from '../../services'; +import { type ApiTokenService, EventService } from '../../services'; import { FeatureEnvironmentEvent } from '../../types/events'; import { addDays, subDays } from 'date-fns'; import { @@ -30,6 +30,7 @@ import type { User } from '../../server-impl'; import { BadDataError, InvalidOperationError } from '../../error'; import { DEFAULT_ENV, extractAuditInfoFromUser } from '../../util'; import { ApiTokenType } from '../../types/models/api-token'; +import { createApiTokenService } from '../api-tokens/createApiTokenService'; let stores: IUnleashStores; let db: ITestDb; @@ -91,7 +92,7 @@ beforeAll(async () => { environmentService = new EnvironmentService(stores, config, eventService); projectService = createProjectService(db.rawDatabase, config); - apiTokenService = new ApiTokenService(stores, config, eventService); + apiTokenService = createApiTokenService(db.rawDatabase, config); }); beforeEach(async () => { await stores.accessStore.addUserToRole(opsUser.id, 1, '');