55} from '@angular/core/testing' ;
66import { Router } from '@angular/router' ;
77import { Store } from '@ngrx/store' ;
8- import { of as observableOf } from 'rxjs' ;
8+ import { of } from 'rxjs' ;
99
1010import { getForbiddenRoute } from '../app-routing-paths' ;
1111import { AuthService } from '../core/auth/auth.service' ;
@@ -68,27 +68,27 @@ describe('BitstreamDownloadRedirectGuard', () => {
6868
6969 function init ( ) {
7070 authService = jasmine . createSpyObj ( 'authService' , {
71- isAuthenticated : observableOf ( true ) ,
71+ isAuthenticated : of ( true ) ,
7272 setRedirectUrl : { } ,
7373 } ) ;
7474 authorizationService = jasmine . createSpyObj ( 'authorizationSerivice' , {
75- isAuthorized : observableOf ( true ) ,
75+ isAuthorized : of ( true ) ,
7676 } ) ;
7777
7878 fileService = jasmine . createSpyObj ( 'fileService' , {
79- retrieveFileDownloadLink : observableOf ( 'content-url-with-headers' ) ,
79+ retrieveFileDownloadLink : of ( 'content-url-with-headers' ) ,
8080 } ) ;
8181
8282 hardRedirectService = jasmine . createSpyObj ( 'fileService' , {
8383 redirect : { } ,
8484 } ) ;
8585
8686 halEndpointService = jasmine . createSpyObj ( 'halEndpointService' , {
87- getEndpoint : observableOf ( 'https://rest.api/core' ) ,
87+ getEndpoint : of ( 'https://rest.api/core' ) ,
8888 } ) ;
8989
9090 remoteDataBuildService = jasmine . createSpyObj ( 'remoteDataBuildService' , {
91- buildSingle : observableOf ( new Bitstream ( ) ) ,
91+ buildSingle : of ( new Bitstream ( ) ) ,
9292 } ) ;
9393
9494 uuidService = jasmine . createSpyObj ( 'uuidService' , {
@@ -107,19 +107,19 @@ describe('BitstreamDownloadRedirectGuard', () => {
107107
108108 store = jasmine . createSpyObj ( 'store' , {
109109 dispatch : { } ,
110- pipe : observableOf ( true ) ,
110+ pipe : of ( true ) ,
111111 } ) ;
112112
113113 serverResponseService = jasmine . createSpyObj ( 'ServerResponseService' , {
114114 setHeader : jasmine . createSpy ( 'setHeader' ) ,
115115 } ) ;
116116
117117 signpostingDataService = jasmine . createSpyObj ( 'SignpostingDataService' , {
118- getLinks : observableOf ( [ mocklink , mocklink2 ] ) ,
118+ getLinks : of ( [ mocklink , mocklink2 ] ) ,
119119 } ) ;
120120
121121 objectCacheService = jasmine . createSpyObj ( 'objectCacheService' , {
122- getByHref : observableOf ( null ) ,
122+ getByHref : of ( null ) ,
123123 } ) ;
124124
125125 bitstreamDataService = jasmine . createSpyObj ( 'bitstreamDataService' , {
@@ -163,7 +163,7 @@ describe('BitstreamDownloadRedirectGuard', () => {
163163 describe ( 'when the user is authorized and not logged in' , ( ) => {
164164 beforeEach ( ( ) => {
165165 init ( ) ;
166- ( authService . isAuthenticated as jasmine . Spy ) . and . returnValue ( observableOf ( false ) ) ;
166+ ( authService . isAuthenticated as jasmine . Spy ) . and . returnValue ( of ( false ) ) ;
167167 initTestbed ( ) ;
168168 } ) ;
169169 it ( 'should redirect to the content link' , waitForAsync ( ( ) => {
@@ -191,7 +191,7 @@ describe('BitstreamDownloadRedirectGuard', () => {
191191 describe ( 'when the user is not authorized and logged in' , ( ) => {
192192 beforeEach ( ( ) => {
193193 init ( ) ;
194- ( authorizationService . isAuthorized as jasmine . Spy ) . and . returnValue ( observableOf ( false ) ) ;
194+ ( authorizationService . isAuthorized as jasmine . Spy ) . and . returnValue ( of ( false ) ) ;
195195 initTestbed ( ) ;
196196 } ) ;
197197 it ( 'should navigate to the forbidden route' , waitForAsync ( ( ) => {
@@ -205,8 +205,8 @@ describe('BitstreamDownloadRedirectGuard', () => {
205205 describe ( 'when the user is not authorized and not logged in' , ( ) => {
206206 beforeEach ( ( ) => {
207207 init ( ) ;
208- ( authService . isAuthenticated as jasmine . Spy ) . and . returnValue ( observableOf ( false ) ) ;
209- ( authorizationService . isAuthorized as jasmine . Spy ) . and . returnValue ( observableOf ( false ) ) ;
208+ ( authService . isAuthenticated as jasmine . Spy ) . and . returnValue ( of ( false ) ) ;
209+ ( authorizationService . isAuthorized as jasmine . Spy ) . and . returnValue ( of ( false ) ) ;
210210 initTestbed ( ) ;
211211 } ) ;
212212 it ( 'should navigate to the login page' , waitForAsync ( ( ) => {
0 commit comments