diff --git a/lib/core/src/lib/auth/guard/auth-guard-bpm.service.spec.ts b/lib/core/src/lib/auth/guard/auth-guard-bpm.service.spec.ts index a954defa17..82af82b478 100644 --- a/lib/core/src/lib/auth/guard/auth-guard-bpm.service.spec.ts +++ b/lib/core/src/lib/auth/guard/auth-guard-bpm.service.spec.ts @@ -27,6 +27,8 @@ import { EMPTY, of } from 'rxjs'; import { OidcAuthenticationService } from '../oidc/oidc-authentication.service'; import { AuthGuardService } from './auth-guard.service'; import { NoopTranslateModule } from '../../testing/noop-translate.module'; +import { JWT_STORAGE_SERVICE } from '../public-api'; +import { StorageService } from '../../common'; describe('AuthGuardService BPM', () => { let authGuard: Promise; @@ -45,6 +47,7 @@ describe('AuthGuardService BPM', () => { providers: [ AuthGuardService, { provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }, + { provide: JWT_STORAGE_SERVICE, useClass: StorageService }, { provide: OidcAuthenticationService, useValue: { diff --git a/lib/core/src/lib/auth/guard/auth-guard-ecm.service.spec.ts b/lib/core/src/lib/auth/guard/auth-guard-ecm.service.spec.ts index 5dd36a8024..14be098718 100644 --- a/lib/core/src/lib/auth/guard/auth-guard-ecm.service.spec.ts +++ b/lib/core/src/lib/auth/guard/auth-guard-ecm.service.spec.ts @@ -27,6 +27,8 @@ import { RedirectAuthService } from '../oidc/redirect-auth.service'; import { EMPTY, of } from 'rxjs'; import { OidcAuthenticationService } from '../oidc/oidc-authentication.service'; import { NoopTranslateModule } from '../../testing/noop-translate.module'; +import { JWT_STORAGE_SERVICE } from '../public-api'; +import { StorageService } from '../../common'; describe('AuthGuardService ECM', () => { let authGuard: Promise; @@ -54,7 +56,8 @@ describe('AuthGuardService ECM', () => { shouldPerformSsoLogin$: of(true) } }, - { provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } } + { provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }, + { provide: JWT_STORAGE_SERVICE, useClass: StorageService } ] }); localStorage.clear(); diff --git a/lib/core/src/lib/auth/guard/auth-guard.service.spec.ts b/lib/core/src/lib/auth/guard/auth-guard.service.spec.ts index edae8def29..24cd906643 100644 --- a/lib/core/src/lib/auth/guard/auth-guard.service.spec.ts +++ b/lib/core/src/lib/auth/guard/auth-guard.service.spec.ts @@ -28,6 +28,7 @@ import { EMPTY, of } from 'rxjs'; import { MatDialogModule } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; import { NoopTranslateModule } from '../../testing/noop-translate.module'; +import { JWT_STORAGE_SERVICE } from '../public-api'; describe('AuthGuardService', () => { let state: RouterStateSnapshot; @@ -45,7 +46,7 @@ describe('AuthGuardService', () => { imports: [NoopTranslateModule, MatDialogModule, RouterTestingModule], providers: [ AppConfigService, - StorageService, + { provide: JWT_STORAGE_SERVICE, useClass: StorageService }, { provide: RedirectAuthService, useValue: { onLogin: EMPTY, onTokenReceived: of() } }, { provide: OidcAuthenticationService, diff --git a/lib/core/src/lib/auth/oidc/oidc-authentication.service.spec.ts b/lib/core/src/lib/auth/oidc/oidc-authentication.service.spec.ts index f9c3cd7089..3a9bd36744 100644 --- a/lib/core/src/lib/auth/oidc/oidc-authentication.service.spec.ts +++ b/lib/core/src/lib/auth/oidc/oidc-authentication.service.spec.ts @@ -65,7 +65,6 @@ describe('OidcAuthenticationService', () => { { provide: OAuthService, useClass: MockOAuthService }, { provide: OAuthStorage, useValue: {} }, { provide: AUTH_MODULE_CONFIG, useValue: {} }, - { provide: AuthService, useValue: {} } ] }); service = TestBed.inject(OidcAuthenticationService); diff --git a/lib/core/src/lib/auth/services/jwt-helper.service.spec.ts b/lib/core/src/lib/auth/services/jwt-helper.service.spec.ts index 5a89c8b828..3bdd8ebf98 100644 --- a/lib/core/src/lib/auth/services/jwt-helper.service.spec.ts +++ b/lib/core/src/lib/auth/services/jwt-helper.service.spec.ts @@ -42,7 +42,7 @@ describe('JwtHelperService', () => { beforeEach(() => { TestBed.configureTestingModule({ - providers: [JwtHelperService, { provide: StorageService, useValue: mockStorage }] + providers: [JwtHelperService, { provide: JWT_STORAGE_SERVICE, useValue: mockStorage }] }); jwtHelperService = TestBed.inject(JwtHelperService); }); diff --git a/lib/core/src/lib/auth/services/user-access.service.spec.ts b/lib/core/src/lib/auth/services/user-access.service.spec.ts index 3629f73cf0..d63767879d 100644 --- a/lib/core/src/lib/auth/services/user-access.service.spec.ts +++ b/lib/core/src/lib/auth/services/user-access.service.spec.ts @@ -30,7 +30,7 @@ describe('UserAccessService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [HttpClientTestingModule], - providers: [UserAccessService, { provide: JWT_STORAGE_SERVICE, useValue: StorageService }] + providers: [{ provide: JWT_STORAGE_SERVICE, useClass: StorageService }, UserAccessService] }); userAccessService = TestBed.inject(UserAccessService); jwtHelperService = TestBed.inject(JwtHelperService);