refactor: Remove base URls with ContainerManager when possible

This commit is contained in:
Joachim Van Herwegen
2020-12-09 16:08:59 +01:00
parent f0db9e501f
commit 1bb5de97ab
10 changed files with 12 additions and 28 deletions

View File

@@ -61,7 +61,7 @@ export const getRootFilePath = (subfolder: string): string => join(__dirname, '.
* @returns The data accessor based store.
*/
export const getDataAccessorStore = (base: string, dataAccessor: DataAccessor): DataAccessorBasedStore =>
new DataAccessorBasedStore(dataAccessor, base, new SingleRootIdentifierStrategy(base));
new DataAccessorBasedStore(dataAccessor, new SingleRootIdentifierStrategy(base));
/**
* Gives an in memory resource store based on (default) base url.

View File

@@ -26,7 +26,7 @@ describe('A LockingResourceStore', (): void => {
const base = 'http://test.com/';
path = `${base}path`;
source = new DataAccessorBasedStore(new InMemoryDataAccessor(base), base, new SingleRootIdentifierStrategy(base));
source = new DataAccessorBasedStore(new InMemoryDataAccessor(base), new SingleRootIdentifierStrategy(base));
locker = new SingleThreadedResourceLocker();
expiringLocker = new WrappedExpiringResourceLocker(locker, 1000);

View File

@@ -8,7 +8,7 @@ import { describeIf, FileTestHelper } from '../util/TestHelpers';
describeIf('docker', 'a server with a SPARQL endpoint as storage', (): void => {
describe('without acl', (): void => {
const config = new DataAccessorBasedConfig(BASE,
new SparqlDataAccessor('http://localhost:4000/sparql', BASE, new SingleRootIdentifierStrategy(BASE)),
new SparqlDataAccessor('http://localhost:4000/sparql', new SingleRootIdentifierStrategy(BASE)),
INTERNAL_QUADS);
const handler = config.getHttpHandler();
const fileHelper = new FileTestHelper(handler, new URL(BASE));

View File

@@ -80,7 +80,7 @@ describe('A DataAccessorBasedStore', (): void => {
beforeEach(async(): Promise<void> => {
accessor = new SimpleDataAccessor();
store = new DataAccessorBasedStore(accessor, root, identifierStrategy);
store = new DataAccessorBasedStore(accessor, identifierStrategy);
containerMetadata = new RepresentationMetadata(
{ [RDF.type]: [ DataFactory.namedNode(LDP.Container), DataFactory.namedNode(LDP.BasicContainer) ]},

View File

@@ -66,7 +66,7 @@ describe('A SparqlDataAccessor', (): void => {
}));
// This needs to be last so the fetcher can be mocked first
accessor = new SparqlDataAccessor(endpoint, base, identifierStrategy);
accessor = new SparqlDataAccessor(endpoint, identifierStrategy);
});
it('can only handle quad data.', async(): Promise<void> => {