Refactored IntegrationService

This commit is contained in:
Giuseppe
2018-10-17 09:17:02 +02:00
parent b27e3d9e2f
commit 8bc7d31864
21 changed files with 121 additions and 56 deletions

View File

@@ -9,6 +9,8 @@ import { HALEndpointService } from '../shared/hal-endpoint.service';
import { HALEndpointServiceStub } from '../../shared/testing/hal-endpoint-service-stub';
import { IntegrationService } from './integration.service';
import { IntegrationSearchOptions } from './models/integration-options.model';
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
import { getMockRemoteDataBuildService } from '../../shared/mocks/mock-remote-data-build.service';
const LINK_NAME = 'authorities';
const BROWSE = 'entries';
@@ -20,6 +22,7 @@ class TestService extends IntegrationService {
constructor(
protected responseCache: ResponseCacheService,
protected requestService: RequestService,
protected rdbService: RemoteDataBuildService,
protected halService: HALEndpointService) {
super();
}
@@ -30,6 +33,7 @@ describe('IntegrationService', () => {
let service: TestService;
let responseCache: ResponseCacheService;
let requestService: RequestService;
let rdbService: RemoteDataBuildService;
let halService: any;
let findOptions: IntegrationSearchOptions;
@@ -55,6 +59,7 @@ describe('IntegrationService', () => {
return new TestService(
responseCache,
requestService,
rdbService,
halService
);
}
@@ -62,6 +67,7 @@ describe('IntegrationService', () => {
beforeEach(() => {
responseCache = initMockResponseCacheService(true);
requestService = getMockRequestService();
rdbService = getMockRemoteDataBuildService();
scheduler = getTestScheduler();
halService = new HALEndpointServiceStub(integrationEndpoint);
findOptions = new IntegrationSearchOptions(uuid, name, metadata, query);