diff --git a/src/app/core/cache/object-cache.service.spec.ts b/src/app/core/cache/object-cache.service.spec.ts index 47b419e6a4..e2bf27e791 100644 --- a/src/app/core/cache/object-cache.service.spec.ts +++ b/src/app/core/cache/object-cache.service.spec.ts @@ -115,13 +115,13 @@ describe('ObjectCacheService', () => { describe('getList', () => { it('should return an observable of the array of cached objects with the specified self link and type', () => { - const item = new NormalizedItem(); - item.self = selfLink; + const item = new Item(); + item._links.self = { href: selfLink }; spyOn(service, 'getObjectBySelfLink').and.returnValue(observableOf(item)); service.getList([selfLink, selfLink]).pipe(first()).subscribe((arr) => { expect(arr[0].self).toBe(selfLink); - expect(arr[0] instanceof NormalizedItem).toBeTruthy(); + expect(arr[0] instanceof Item).toBeTruthy(); }); }); }); diff --git a/src/app/core/cache/server-sync-buffer.effects.spec.ts b/src/app/core/cache/server-sync-buffer.effects.spec.ts index 773e0ab60c..52407270c2 100644 --- a/src/app/core/cache/server-sync-buffer.effects.spec.ts +++ b/src/app/core/cache/server-sync-buffer.effects.spec.ts @@ -48,7 +48,7 @@ describe('ServerSyncBufferEffects', () => { provide: ObjectCacheService, useValue: { getObjectBySelfLink: (link) => { const object = new DSpaceObject(); - object.self = link; + object._links.self = { href: link }; return observableOf(object); } } diff --git a/src/app/core/data/data.service.spec.ts b/src/app/core/data/data.service.spec.ts index ca5f2cc12e..2244b4c346 100644 --- a/src/app/core/data/data.service.spec.ts +++ b/src/app/core/data/data.service.spec.ts @@ -185,11 +185,11 @@ describe('DataService', () => { selfLink = 'https://rest.api/endpoint/1698f1d3-be98-4c51-9fd8-6bfedcbd59b7'; dso = new DSpaceObject(); - dso.self = selfLink; + dso._links.self = { href: selfLink }; dso.metadata = [{ key: 'dc.title', value: name1 }]; dso2 = new DSpaceObject(); - dso2.self = selfLink; + dso2._link.self = { href: selfLink }; dso2.metadata = [{ key: 'dc.title', value: name2 }]; spyOn(service, 'findByHref').and.returnValue(createSuccessfulRemoteDataObject$(dso)); diff --git a/src/app/shared/testing/eperson-mock.ts b/src/app/shared/testing/eperson-mock.ts index c822fc15d6..44585f278f 100644 --- a/src/app/shared/testing/eperson-mock.ts +++ b/src/app/shared/testing/eperson-mock.ts @@ -9,7 +9,11 @@ export const EPersonMock: EPerson = Object.assign(new EPerson(),{ email: 'test@test.com', requireCertificate: false, selfRegistered: false, - self: 'https://dspace.4science.it/dspace-spring-rest/api/eperson/epersons/testid', + _links: { + self: { + href: 'https://dspace.4science.it/dspace-spring-rest/api/eperson/epersons/testid', + } + }, id: 'testid', uuid: 'testid', type: 'eperson',