From 5e9b0430760e5d32b477bce5ae0479602521e6c7 Mon Sep 17 00:00:00 2001 From: samuel Date: Wed, 3 Apr 2024 11:10:08 +0200 Subject: [PATCH] fix --- .../src/engine/__test__/e2e/engine.spec.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/policy-engine/src/engine/__test__/e2e/engine.spec.ts b/apps/policy-engine/src/engine/__test__/e2e/engine.spec.ts index 33e3ac751..aa1c3d106 100644 --- a/apps/policy-engine/src/engine/__test__/e2e/engine.spec.ts +++ b/apps/policy-engine/src/engine/__test__/e2e/engine.spec.ts @@ -16,18 +16,18 @@ import { InMemoryKeyValueRepository } from '../../../shared/module/key-value/per import { TestPrismaService } from '../../../shared/module/persistence/service/test-prisma.service' import { getEntityStore, getPolicyStore } from '../../../shared/testing/data-store.testing' import { getTestRawAesKeyring } from '../../../shared/testing/encryption.testing' -import { Tenant } from '../../../shared/type/domain.type' +import { Client } from '../../../shared/type/domain.type' +import { ClientService } from '../../core/service/client.service' import { EngineSignerConfigService } from '../../core/service/engine-signer-config.service' -import { TenantService } from '../../core/service/tenant.service' import { EngineModule } from '../../engine.module' describe('Engine', () => { let app: INestApplication let privateKey: PrivateKey let module: TestingModule - let tenant: Tenant + let client: Client let enginePublicJwk: PublicKey - let tenantService: TenantService + let clientService: ClientService let testPrismaService: TestPrismaService let configService: ConfigService @@ -60,7 +60,7 @@ describe('Engine', () => { const engineService = module.get(EngineService) const engineSignerConfigService = module.get(EngineSignerConfigService) configService = module.get>(ConfigService) - tenantService = module.get(TenantService) + clientService = module.get(ClientService) testPrismaService = module.get(TestPrismaService) await testPrismaService.truncateAll() @@ -84,7 +84,7 @@ describe('Engine', () => { key: privateKey }) - tenant = await tenantService.onboard( + client = await clientService.onboard( { clientId, clientSecret: randomBytes(42).toString('hex'), @@ -100,8 +100,8 @@ describe('Engine', () => { enginePublicJwk = await engineSignerConfigService.getPublicJwkOrThrow() - await tenantService.savePolicyStore(tenant.clientId, await getPolicyStore([], privateKey)) - await tenantService.saveEntityStore(tenant.clientId, await getEntityStore(FIXTURE.ENTITIES, privateKey)) + await clientService.savePolicyStore(client.clientId, await getPolicyStore([], privateKey)) + await clientService.saveEntityStore(client.clientId, await getEntityStore(FIXTURE.ENTITIES, privateKey)) await app.init() }) @@ -116,8 +116,8 @@ describe('Engine', () => { it('returns engine id + public jwk', async () => { const { status, body } = await request(app.getHttpServer()) .get('/engine') - .set(REQUEST_HEADER_CLIENT_ID, tenant.clientId) - .set(REQUEST_HEADER_CLIENT_SECRET, tenant.clientSecret) + .set(REQUEST_HEADER_CLIENT_ID, client.clientId) + .set(REQUEST_HEADER_CLIENT_SECRET, client.clientSecret) expect(body).toEqual(enginePublicJwk) expect(status).toEqual(HttpStatus.OK)