diff --git a/plugins/tech-insights-backend/src/service/techInsightsContextBuilder.test.ts b/plugins/tech-insights-backend/src/service/techInsightsContextBuilder.test.ts index 46d1e61e22..82f504c8a8 100644 --- a/plugins/tech-insights-backend/src/service/techInsightsContextBuilder.test.ts +++ b/plugins/tech-insights-backend/src/service/techInsightsContextBuilder.test.ts @@ -27,9 +27,11 @@ import { Knex } from 'knex'; jest.mock('./fact/FactRetrieverRegistry'); jest.mock('./fact/FactRetrieverEngine', () => ({ - create: jest.fn().mockResolvedValue({ - schedule: jest.fn(), - }), + FactRetrieverEngine: { + create: jest.fn().mockResolvedValue({ + schedule: jest.fn(), + }), + }, })); describe('buildTechInsightsContext', () => { @@ -68,7 +70,6 @@ describe('buildTechInsightsContext', () => { discovery: discoveryMock, tokenManager: ServerTokenManager.noop(), }); - expect(DefaultFactRetrieverRegistry).toHaveBeenCalledTimes(1); }); @@ -85,7 +86,6 @@ describe('buildTechInsightsContext', () => { discovery: discoveryMock, tokenManager: ServerTokenManager.noop(), }); - expect(DefaultFactRetrieverRegistry).not.toHaveBeenCalled(); }); }); diff --git a/plugins/tech-insights-backend/src/service/techInsightsContextBuilder.ts b/plugins/tech-insights-backend/src/service/techInsightsContextBuilder.ts index 008acf192d..1ce87adb96 100644 --- a/plugins/tech-insights-backend/src/service/techInsightsContextBuilder.ts +++ b/plugins/tech-insights-backend/src/service/techInsightsContextBuilder.ts @@ -120,6 +120,7 @@ export const buildTechInsightsContext = async < scheduler, tokenManager, } = options; + logger.info('HERE1'); const buildFactRetrieverRegistry = (): FactRetrieverRegistry => { if (!options.factRetrieverRegistry) { @@ -139,6 +140,7 @@ export const buildTechInsightsContext = async < await database.getClient(), { logger }, ); + logger.info('HERE2'); const factRetrieverEngine = await FactRetrieverEngine.create({ scheduler,