1
0

[DURACOM-191] Fix circular dependency

This commit is contained in:
Giuseppe Digilio
2024-03-17 15:48:05 +01:00
parent f527810545
commit 788e44a770
2 changed files with 19 additions and 19 deletions

View File

@@ -1,18 +1,13 @@
/* eslint-disable max-classes-per-file */ /* eslint-disable max-classes-per-file */
import { Injectable } from '@angular/core';
import { TestBed } from '@angular/core/testing'; import { TestBed } from '@angular/core/testing';
import { of } from 'rxjs';
import { import {
isEmpty, isEmpty,
take, take,
} from 'rxjs/operators'; } from 'rxjs/operators';
import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface'; import { APP_DATA_SERVICES_MAP } from '../../../../config/app-config.interface';
import { import { TestDataService } from '../../../shared/testing/test-data-service.mock';
followLink, import { followLink } from '../../../shared/utils/follow-link-config.model';
FollowLinkConfig,
} from '../../../shared/utils/follow-link-config.model';
import { FindListOptions } from '../../data/find-list-options.model';
import { HALLink } from '../../shared/hal-link.model'; import { HALLink } from '../../shared/hal-link.model';
import { HALResource } from '../../shared/hal-resource.model'; import { HALResource } from '../../shared/hal-resource.model';
import { ResourceType } from '../../shared/resource-type'; import { ResourceType } from '../../shared/resource-type';
@@ -42,19 +37,8 @@ class TestModel implements HALResource {
successor?: TestModel; successor?: TestModel;
} }
@Injectable()
export class TestDataService {
findListByHref(href: string, findListOptions: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig<any>[]) {
return of('findListByHref');
}
findByHref(href: string, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig<any>[]) {
return of('findByHref');
}
}
const mockDataServiceMap: any = { const mockDataServiceMap: any = {
[TEST_MODEL.value]: () => import('./link.service.spec').then(m => m.TestDataService), [TEST_MODEL.value]: () => import('../../../shared/testing/test-data-service.mock').then(m => m.TestDataService),
}; };
let testDataService: TestDataService; let testDataService: TestDataService;

View File

@@ -0,0 +1,16 @@
import { Injectable } from '@angular/core';
import { of } from 'rxjs';
import { FindListOptions } from '../../core/data/find-list-options.model';
import { FollowLinkConfig } from '../utils/follow-link-config.model';
@Injectable()
export class TestDataService {
findListByHref(href: string, findListOptions: FindListOptions = {}, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig<any>[]) {
return of('findListByHref');
}
findByHref(href: string, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig<any>[]) {
return of('findByHref');
}
}