diff --git a/plugins/stack-overflow/src/api/StackOverflowClient.test.ts b/plugins/stack-overflow/src/api/StackOverflowClient.test.ts index 78909f9e6d..6574771350 100644 --- a/plugins/stack-overflow/src/api/StackOverflowClient.test.ts +++ b/plugins/stack-overflow/src/api/StackOverflowClient.test.ts @@ -19,6 +19,7 @@ import { rest } from 'msw'; import { setupServer } from 'msw/node'; import { StackOverflowClient } from './index'; import { StackOverflowQuestion } from '../types'; +import { ConfigReader } from '@backstage/config'; const server = setupServer(); @@ -61,9 +62,13 @@ describe('StackOverflowClient', () => { it('list questions should return all questions', async () => { setupHandlers(); - const client = new StackOverflowClient({ - baseUrl: 'https://example.com:9191', - }); + const client = StackOverflowClient.fromConfig( + new ConfigReader({ + stackoverflow: { + baseUrl: 'https://example.com:9191', + }, + }), + ); const responseQuestions = await client.listQuestions({ requestParams: { tagged: 'backstage' }, diff --git a/plugins/stack-overflow/src/api/StackOverflowClient.ts b/plugins/stack-overflow/src/api/StackOverflowClient.ts index 609af9dfd4..f4ff5bf190 100644 --- a/plugins/stack-overflow/src/api/StackOverflowClient.ts +++ b/plugins/stack-overflow/src/api/StackOverflowClient.ts @@ -26,7 +26,7 @@ import { Config } from '@backstage/config'; export class StackOverflowClient implements StackOverflowApi { private baseUrl: string; - constructor({ baseUrl }: { baseUrl: string }) { + private constructor({ baseUrl }: { baseUrl: string }) { this.baseUrl = baseUrl; }