Merge "Add functionality to truncate amount of instances"
[portal/nonrtric-controlpanel.git] / webapp-frontend / src / app / interceptor.spec.ts
index 3c35a71..2c44d13 100644 (file)
@@ -25,12 +25,12 @@ import {
 } from '@angular/common/http/testing';
 import { HTTP_INTERCEPTORS } from '@angular/common/http';
 import { HttpRequestInterceptor } from './interceptor';
-import { NotificationService } from './services/ui/notification.service';
-import { EIService } from './services/ei/ei.service';
+import { NotificationService } from '@services/ui/notification.service';
+import { ProducerService } from '@services/ei/producer.service';
 import { of } from 'rxjs/observable/of';
 
 describe(`HttpRequestInterceptor`, () => {
-    let service: EIService;
+    let service: ProducerService;
     const notificationServiceSpy = jasmine.createSpyObj('NotificationService', [ 'error' ]);
     let httpMock: HttpTestingController;
 
@@ -47,16 +47,16 @@ describe(`HttpRequestInterceptor`, () => {
                     useClass: HttpRequestInterceptor,
                     multi: true,
                 },
-                EIService
+                ProducerService
             ]
         });
 
-        httpMock = TestBed.get(HttpTestingController);
-        service = TestBed.get(EIService);
+        httpMock = TestBed.inject(HttpTestingController);
+        service = TestBed.inject(ProducerService);
     });
 
     it('should create', () => {
-        const interceptors = TestBed.get(HTTP_INTERCEPTORS);
+        const interceptors = TestBed.inject(HTTP_INTERCEPTORS);
         let found = false;
         interceptors.forEach(interceptor => {
             if (interceptor instanceof HttpRequestInterceptor) {
@@ -85,7 +85,7 @@ describe(`HttpRequestInterceptor`, () => {
 
     const data = 'Invalid request parameters';
     const mockErrorResponse = { status: 400, statusText: 'Bad Request' };
-    httpMock.expectOne(`/ei-producer/v1/eiproducers`).flush(data, mockErrorResponse);
+    httpMock.expectOne(`/data-producer/v1/info-producers`).flush(data, mockErrorResponse);
 
     httpMock.verify();