} 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;
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) {
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();