jenkins-backend: depend on interface rather than implementation
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CatalogClient } from '@backstage/catalog-client';
|
||||
import { CatalogApi } from '@backstage/catalog-client';
|
||||
import { Entity, EntityName } from '@backstage/catalog-model';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import {
|
||||
@@ -159,9 +159,9 @@ describe('JenkinsConfig', () => {
|
||||
});
|
||||
|
||||
describe('DefaultJenkinsInfoProvider', () => {
|
||||
const mockCatalog: jest.Mocked<CatalogClient> = {
|
||||
const mockCatalog: jest.Mocked<CatalogApi> = {
|
||||
getEntityByName: jest.fn(),
|
||||
} as any as jest.Mocked<CatalogClient>;
|
||||
} as any as jest.Mocked<CatalogApi>;
|
||||
|
||||
const entityRef: EntityName = {
|
||||
kind: 'Component',
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CatalogClient } from '@backstage/catalog-client';
|
||||
import { CatalogApi } from '@backstage/catalog-client';
|
||||
import {
|
||||
Entity,
|
||||
EntityName,
|
||||
@@ -168,12 +168,12 @@ export class DefaultJenkinsInfoProvider implements JenkinsInfoProvider {
|
||||
|
||||
private constructor(
|
||||
private readonly config: JenkinsConfig,
|
||||
private readonly catalog: CatalogClient,
|
||||
private readonly catalog: CatalogApi,
|
||||
) {}
|
||||
|
||||
static fromConfig(options: {
|
||||
config: Config;
|
||||
catalog: CatalogClient;
|
||||
catalog: CatalogApi;
|
||||
}): DefaultJenkinsInfoProvider {
|
||||
return new DefaultJenkinsInfoProvider(
|
||||
JenkinsConfig.fromConfig(options.config),
|
||||
|
||||
Reference in New Issue
Block a user