feat: Pass ResourceStore as param to PatchHandler

This way the chain of ResourceStores is a bit easier to configure.
This commit also updates the SparqlUpdatePatchHandler to keep the metadata
and content-type of the resource that is being modified.
This commit is contained in:
Joachim Van Herwegen
2021-05-07 10:31:21 +02:00
parent 0f22fb5ddb
commit 8491300f42
6 changed files with 139 additions and 45 deletions

View File

@@ -35,6 +35,6 @@ describe('A PatchingStore', (): void => {
expect(source.modifyResource).toHaveBeenLastCalledWith({ path: 'modifyPath' }, {}, undefined);
await expect((source.modifyResource as jest.Mock).mock.results[0].value).rejects.toThrow('dummy');
expect(handleSafeFn).toHaveBeenCalledTimes(1);
expect(handleSafeFn).toHaveBeenLastCalledWith({ identifier: { path: 'modifyPath' }, patch: {}});
expect(handleSafeFn).toHaveBeenLastCalledWith({ source, identifier: { path: 'modifyPath' }, patch: {}});
});
});