From 4df0521501eaf9e4f45e19395de9ba5ad1308267 Mon Sep 17 00:00:00 2001 From: Tobias Schweizer Date: Wed, 13 May 2020 18:45:52 +0200 Subject: [PATCH 01/10] fix (ontology cache): ignore third-party properties consistently --- src/cache/OntologyCache.spec.ts | 3 ++- src/cache/OntologyCache.ts | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cache/OntologyCache.spec.ts b/src/cache/OntologyCache.spec.ts index c318572c0..33742cd55 100644 --- a/src/cache/OntologyCache.spec.ts +++ b/src/cache/OntologyCache.spec.ts @@ -159,12 +159,13 @@ describe("OntologyCache", () => { describe("Method getResourceClass()", () => { - it("should get the definition of a resource class and its properties", done => { + it("should get the definition of a resource class and its properties", done => { knoraApiConnection.v2.ontologyCache.getResourceClassDefinition("http://0.0.0.0:3333/ontology/0001/anything/v2#Thing").subscribe( resClassDef => { expect(resClassDef.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"] instanceof ResourceClassDefinition).toBeTruthy(); + expect(resClassDef.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"].propertiesList.length).toEqual(38); expect(Object.keys(resClassDef.properties).length).toEqual(38); done(); diff --git a/src/cache/OntologyCache.ts b/src/cache/OntologyCache.ts index 39db660e7..9e86f3b7a 100644 --- a/src/cache/OntologyCache.ts +++ b/src/cache/OntologyCache.ts @@ -114,6 +114,13 @@ export class OntologyCache extends GenericCache { requestedEntityDefs.classes[resourceClassIri] = mainOnto.classes[resourceClassIri]; + // filter out non Knora properties + requestedEntityDefs.classes[resourceClassIri].propertiesList = requestedEntityDefs.classes[resourceClassIri].propertiesList.filter( + (hasProp: IHasProperty) => { + return OntologyConversionUtil.getOntologyIriFromEntityIri(hasProp.propertyIndex, this.knoraApiConfig).length === 1; + } + ); + mainOnto.classes[resourceClassIri].propertiesList.forEach( (prop: IHasProperty) => { @@ -125,7 +132,6 @@ export class OntologyCache extends GenericCache { const fromOnto = ontosMap.get(fromOntoIri[0]); if (fromOnto === undefined) throw new Error("Expected ontology not found"); - requestedEntityDefs.properties[prop.propertyIndex] = fromOnto.properties[prop.propertyIndex]; } From 8f82476ebd34ad001cc64f5f8347e4cfcd487e1f Mon Sep 17 00:00:00 2001 From: Tobias Schweizer Date: Wed, 13 May 2020 19:05:46 +0200 Subject: [PATCH 02/10] tests (github-ci): try curl without --fail flag --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 21619fbec..6ecf6ec47 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ generate-test-data: ## downloads generated test data from Knora-API @rm -rf $(CURRENT_DIR)/.tmp/typescript mkdir -p $(CURRENT_DIR)/.tmp/typescript sleep 120 - curl --fail -o $(CURRENT_DIR)/.tmp/ts.zip http://localhost:3333/clientapitest + curl -o $(CURRENT_DIR)/.tmp/ts.zip http://localhost:3333/clientapitest sleep 45 unzip $(CURRENT_DIR)/.tmp/ts.zip -d $(CURRENT_DIR)/.tmp/typescript From 432e98cb5e0251f410d84961abfdb017147f50e4 Mon Sep 17 00:00:00 2001 From: Tobias Schweizer Date: Thu, 14 May 2020 08:18:07 +0200 Subject: [PATCH 03/10] tests (github-ci): increase sleep to sleeping sickness --- Makefile | 4 ++-- src/cache/OntologyCache.ts | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 6ecf6ec47..eaada08b5 100644 --- a/Makefile +++ b/Makefile @@ -39,9 +39,9 @@ knora-stack: ## runs the knora-stack generate-test-data: ## downloads generated test data from Knora-API @rm -rf $(CURRENT_DIR)/.tmp/typescript mkdir -p $(CURRENT_DIR)/.tmp/typescript - sleep 120 + sleep 240 curl -o $(CURRENT_DIR)/.tmp/ts.zip http://localhost:3333/clientapitest - sleep 45 + sleep 120 unzip $(CURRENT_DIR)/.tmp/ts.zip -d $(CURRENT_DIR)/.tmp/typescript .PHONY: integrate-test-data diff --git a/src/cache/OntologyCache.ts b/src/cache/OntologyCache.ts index 9e86f3b7a..e6b61a3e1 100644 --- a/src/cache/OntologyCache.ts +++ b/src/cache/OntologyCache.ts @@ -121,12 +121,13 @@ export class OntologyCache extends GenericCache { } ); - mainOnto.classes[resourceClassIri].propertiesList.forEach( + requestedEntityDefs.classes[resourceClassIri].propertiesList.forEach( (prop: IHasProperty) => { + // prop could refer to entities in the ontology the requested resource class belongs to + // or to other ontologies the resource class has prop cardinalities for, e.g. knora api or another project ontology. const fromOntoIri = OntologyConversionUtil.getOntologyIriFromEntityIri(prop.propertyIndex, this.knoraApiConfig); - // only handle Knora property definitions if (fromOntoIri.length === 1) { const fromOnto = ontosMap.get(fromOntoIri[0]); From b8e0fc9b9567bad3d7df0e39060bd80d88f843ef Mon Sep 17 00:00:00 2001 From: Tobias Schweizer Date: Thu, 14 May 2020 08:55:06 +0200 Subject: [PATCH 04/10] tests (mock ontology): make the mocked ontology cache behave as the productive one --- test/data/api/v2/mockOntology.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/data/api/v2/mockOntology.ts b/test/data/api/v2/mockOntology.ts index b9421b702..7a4536262 100644 --- a/test/data/api/v2/mockOntology.ts +++ b/test/data/api/v2/mockOntology.ts @@ -1,6 +1,8 @@ import { JsonConvert, OperationMode, ValueCheckingMode } from "json2typescript"; import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-convert-enums"; import { IResourceClassAndPropertyDefinitions } from "../../../../src/cache/OntologyCache"; +import { Constants } from "../../../../src/models/v2/Constants"; +import { IHasProperty } from "../../../../src/models/v2/ontologies/class-definition"; import { OntologyConversionUtil } from "../../../../src/models/v2/ontologies/OntologyConversionUtil"; import { ReadOntology } from "../../../../src/models/v2/ontologies/read-ontology"; import { ResourceClassDefinition } from "../../../../src/models/v2/ontologies/resource-class-definition"; @@ -87,7 +89,6 @@ export namespace MockOntology { const knoraApiOntology: any = knoraApiOntologyExpanded; const incunabulaOntology: any = incunabulaOntologyExpanded; - const knoraApiEntities = (knoraApiOntology as { [index: string]: object[] })["@graph"]; const anythingEntities = (anythingOntology as { [index: string]: object[] })["@graph"]; const incunabulaEntities = (incunabulaOntology as { [index: string]: object[] })["@graph"]; @@ -102,6 +103,13 @@ export namespace MockOntology { entityMock.classes[resClass.id] = resClass; }); + entityMock.classes[resClassIri].propertiesList = entityMock.classes[resClassIri].propertiesList.filter( + (prop: IHasProperty) => { + // exclude rdfs:label + return prop.propertyIndex !== Constants.Label; + } + ); + // properties of anything Thing const props: string[] = entityMock.classes[resClassIri].propertiesList.map(prop => prop.propertyIndex); From 6ec079e5773bbe6a8628ae234f8846faa702fc12 Mon Sep 17 00:00:00 2001 From: Tobias Schweizer Date: Thu, 14 May 2020 09:09:59 +0200 Subject: [PATCH 05/10] tests (mock ontology): make sure the mocked ontologies conform with the ontologies in production --- src/cache/OntologyCache.spec.ts | 5 ++ .../resources/ResourcesConversionUtil.spec.ts | 5 ++ test/data/api/v2/mock-ontology-assertions.ts | 48 +++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 test/data/api/v2/mock-ontology-assertions.ts diff --git a/src/cache/OntologyCache.spec.ts b/src/cache/OntologyCache.spec.ts index 33742cd55..b5bf8008d 100644 --- a/src/cache/OntologyCache.spec.ts +++ b/src/cache/OntologyCache.spec.ts @@ -1,5 +1,6 @@ import { of } from "rxjs"; import { MockOntology } from "../../test/data/api/v2/mockOntology"; +import { MockOntologyAssertions } from "../../test/data/api/v2/mock-ontology-assertions"; import { KnoraApiConfig } from "../knora-api-config"; import { KnoraApiConnection } from "../knora-api-connection"; import { ReadOntology } from "../models/v2/ontologies/read-ontology"; @@ -165,8 +166,12 @@ describe("OntologyCache", () => { resClassDef => { expect(resClassDef.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"] instanceof ResourceClassDefinition).toBeTruthy(); + expect(resClassDef.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"].propertiesList.length).toEqual(38); + expect(resClassDef.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"].propertiesList.length).toEqual(MockOntologyAssertions.propertiesAnythingThing.length); + expect(Object.keys(resClassDef.properties).length).toEqual(38); + expect(Object.keys(resClassDef.properties).length).toEqual(MockOntologyAssertions.propertiesAnythingThing.length); done(); diff --git a/src/models/v2/resources/ResourcesConversionUtil.spec.ts b/src/models/v2/resources/ResourcesConversionUtil.spec.ts index b6a5c7001..8d11ce734 100644 --- a/src/models/v2/resources/ResourcesConversionUtil.spec.ts +++ b/src/models/v2/resources/ResourcesConversionUtil.spec.ts @@ -3,6 +3,7 @@ import { PropertyMatchingRule } from "json2typescript/src/json2typescript/json-c import { of } from "rxjs"; import { MockList } from "../../../../test/data/api/v2/mockList"; import { MockOntology } from "../../../../test/data/api/v2/mockOntology"; +import { MockOntologyAssertions } from "../../../../test/data/api/v2/mock-ontology-assertions"; import { KnoraApiConfig } from "../../../knora-api-config"; import { KnoraApiConnection } from "../../../knora-api-connection"; import { ReadResource } from "./read/read-resource"; @@ -73,6 +74,10 @@ describe("ResourcesConversionUtil", () => { expect(resSeq.resources.length).toEqual(1); + // make sure that mocked cache works as expected + expect(resSeq.resources[0].entityInfo.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"].propertiesList.length).toEqual(MockOntologyAssertions.propertiesAnythingThing.length); + expect(Object.keys(resSeq.resources[0].entityInfo.properties).length).toEqual(MockOntologyAssertions.propertiesAnythingThing.length); + expect(resSeq.resources[0].id).toEqual("http://rdfh.ch/0001/H6gBWUuJSuuO-CilHV8kQw"); expect(resSeq.resources[0].type).toEqual("http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"); expect(resSeq.resources[0].label).toEqual("testding"); diff --git a/test/data/api/v2/mock-ontology-assertions.ts b/test/data/api/v2/mock-ontology-assertions.ts new file mode 100644 index 000000000..faa2c46f2 --- /dev/null +++ b/test/data/api/v2/mock-ontology-assertions.ts @@ -0,0 +1,48 @@ +/** + * This class contains assertions for the mocked ontologies + * so that the behave as the lib's ontology handling in production. + */ +export class MockOntologyAssertions { + + static propertiesAnythingThing = [ + "http://api.knora.org/ontology/knora-api/v2#arkUrl", + "http://api.knora.org/ontology/knora-api/v2#attachedToProject", + "http://api.knora.org/ontology/knora-api/v2#attachedToUser", + "http://api.knora.org/ontology/knora-api/v2#creationDate", + "http://api.knora.org/ontology/knora-api/v2#deleteComment", + "http://api.knora.org/ontology/knora-api/v2#deleteDate", + "http://api.knora.org/ontology/knora-api/v2#deletedBy", + "http://api.knora.org/ontology/knora-api/v2#hasIncomingLinkValue", + "http://api.knora.org/ontology/knora-api/v2#hasPermissions", + "http://api.knora.org/ontology/knora-api/v2#hasStandoffLinkTo", + "http://api.knora.org/ontology/knora-api/v2#hasStandoffLinkToValue", + "http://api.knora.org/ontology/knora-api/v2#isDeleted", + "http://api.knora.org/ontology/knora-api/v2#lastModificationDate", + "http://api.knora.org/ontology/knora-api/v2#userHasPermission", + "http://api.knora.org/ontology/knora-api/v2#versionArkUrl", + "http://api.knora.org/ontology/knora-api/v2#versionDate", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasListItem", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasOtherListItem", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasOtherThing", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasOtherThingValue", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasRichtext", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasText", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasDate", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasInteger", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasDecimal", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasBoolean", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasUri", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasInterval", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasColor", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasGeometry", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasGeoname", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasThingDocument", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasThingDocumentValue", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasThingPicture", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasThingPictureValue", + "http://0.0.0.0:3333/ontology/0001/anything/v2#hasTimeStamp", + "http://0.0.0.0:3333/ontology/0001/anything/v2#isPartOfOtherThing", + "http://0.0.0.0:3333/ontology/0001/anything/v2#isPartOfOtherThingValue" + ]; + +} From 61b290f1ca7aaf2670e1fad9d62178e206e182c7 Mon Sep 17 00:00:00 2001 From: Tobias Schweizer Date: Thu, 14 May 2020 09:48:28 +0200 Subject: [PATCH 06/10] tests (github-ci): insist on getting that zip --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index eaada08b5..8b2ce43ba 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ generate-test-data: ## downloads generated test data from Knora-API @rm -rf $(CURRENT_DIR)/.tmp/typescript mkdir -p $(CURRENT_DIR)/.tmp/typescript sleep 240 - curl -o $(CURRENT_DIR)/.tmp/ts.zip http://localhost:3333/clientapitest + curl --fail --retry 5 --retry-connrefused -w http_code -o $(CURRENT_DIR)/.tmp/ts.zip http://localhost:3333/clientapitest sleep 120 unzip $(CURRENT_DIR)/.tmp/ts.zip -d $(CURRENT_DIR)/.tmp/typescript From 11f69c1ea2c471769ab4b013dcb5c2fb9653adb1 Mon Sep 17 00:00:00 2001 From: Tobias Schweizer Date: Thu, 14 May 2020 09:58:04 +0200 Subject: [PATCH 07/10] tests (mock ontology): make sure the mocked ontologies conform with the ontologies in production --- src/cache/OntologyCache.spec.ts | 6 ++++-- src/models/v2/resources/ResourcesConversionUtil.spec.ts | 8 +++++--- test/data/api/v2/mock-ontology-assertions.ts | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/cache/OntologyCache.spec.ts b/src/cache/OntologyCache.spec.ts index b5bf8008d..7d298a460 100644 --- a/src/cache/OntologyCache.spec.ts +++ b/src/cache/OntologyCache.spec.ts @@ -168,10 +168,12 @@ describe("OntologyCache", () => { expect(resClassDef.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"] instanceof ResourceClassDefinition).toBeTruthy(); expect(resClassDef.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"].propertiesList.length).toEqual(38); - expect(resClassDef.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"].propertiesList.length).toEqual(MockOntologyAssertions.propertiesAnythingThing.length); + expect(resClassDef.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"].propertiesList.map(prop => prop.propertyIndex).sort()).toEqual(MockOntologyAssertions.propertyIndexesAnythingThing.sort()); + expect(resClassDef.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"].propertiesList.length).toEqual(MockOntologyAssertions.propertyIndexesAnythingThing.length); expect(Object.keys(resClassDef.properties).length).toEqual(38); - expect(Object.keys(resClassDef.properties).length).toEqual(MockOntologyAssertions.propertiesAnythingThing.length); + expect(Object.keys(resClassDef.properties).sort()).toEqual(MockOntologyAssertions.propertyIndexesAnythingThing.sort()); + expect(Object.keys(resClassDef.properties).length).toEqual(MockOntologyAssertions.propertyIndexesAnythingThing.length); done(); diff --git a/src/models/v2/resources/ResourcesConversionUtil.spec.ts b/src/models/v2/resources/ResourcesConversionUtil.spec.ts index 8d11ce734..30bd1cd46 100644 --- a/src/models/v2/resources/ResourcesConversionUtil.spec.ts +++ b/src/models/v2/resources/ResourcesConversionUtil.spec.ts @@ -74,9 +74,11 @@ describe("ResourcesConversionUtil", () => { expect(resSeq.resources.length).toEqual(1); - // make sure that mocked cache works as expected - expect(resSeq.resources[0].entityInfo.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"].propertiesList.length).toEqual(MockOntologyAssertions.propertiesAnythingThing.length); - expect(Object.keys(resSeq.resources[0].entityInfo.properties).length).toEqual(MockOntologyAssertions.propertiesAnythingThing.length); + // make sure that mocked ontology cache works as expected + expect(resSeq.resources[0].entityInfo.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"].propertiesList.length).toEqual(MockOntologyAssertions.propertyIndexesAnythingThing.length); + expect(resSeq.resources[0].entityInfo.classes["http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"].propertiesList.map(prop => prop.propertyIndex).sort()).toEqual(MockOntologyAssertions.propertyIndexesAnythingThing.sort()); + expect(Object.keys(resSeq.resources[0].entityInfo.properties).length).toEqual(MockOntologyAssertions.propertyIndexesAnythingThing.length); + expect(Object.keys(resSeq.resources[0].entityInfo.properties).sort()).toEqual(MockOntologyAssertions.propertyIndexesAnythingThing.sort()); expect(resSeq.resources[0].id).toEqual("http://rdfh.ch/0001/H6gBWUuJSuuO-CilHV8kQw"); expect(resSeq.resources[0].type).toEqual("http://0.0.0.0:3333/ontology/0001/anything/v2#Thing"); diff --git a/test/data/api/v2/mock-ontology-assertions.ts b/test/data/api/v2/mock-ontology-assertions.ts index faa2c46f2..a6267d49e 100644 --- a/test/data/api/v2/mock-ontology-assertions.ts +++ b/test/data/api/v2/mock-ontology-assertions.ts @@ -4,7 +4,7 @@ */ export class MockOntologyAssertions { - static propertiesAnythingThing = [ + static propertyIndexesAnythingThing = [ "http://api.knora.org/ontology/knora-api/v2#arkUrl", "http://api.knora.org/ontology/knora-api/v2#attachedToProject", "http://api.knora.org/ontology/knora-api/v2#attachedToUser", From 498187631e67529fffccfbdada5b3aee27f47291 Mon Sep 17 00:00:00 2001 From: Tobias Schweizer Date: Thu, 14 May 2020 10:19:35 +0200 Subject: [PATCH 08/10] tests (github-ci): run against Knora v13.0.0-PR1 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8b2ce43ba..3a8e45070 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ include vars.mk # Clones the knora-api git repository .PHONY: clone-knora-stack clone-knora-stack: - @git clone --single-branch --depth 1 https://github.com/dasch-swiss/knora-api.git $(CURRENT_DIR)/.tmp/knora-stack + @git clone --branch v13.0.0-PR1 --single-branch --depth 1 https://github.com/dasch-swiss/knora-api.git $(CURRENT_DIR)/.tmp/knora-stack ################################# # Integration test targets From a89b6afb7d60f2502af206d2113767915c8d730e Mon Sep 17 00:00:00 2001 From: Tobias Schweizer Date: Thu, 14 May 2020 15:28:10 +0200 Subject: [PATCH 09/10] docs (design docs): add section about tests --- design-documentation.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/design-documentation.md b/design-documentation.md index c108ed7ff..df813f136 100644 --- a/design-documentation.md +++ b/design-documentation.md @@ -137,4 +137,21 @@ Caching is necessary to avoid making redundant calls to the Knora API and proces `ListNodeV2Cache` caches v2 list nodes. As an optimization, the entire list is regarded as a dependency of any given list node and requested. Like this, all list nodes can be fetched with one request and written to the cache. -```` +### Tests + +Component have their own spec files defining unit tests. +Since this library relies on Knora API, +static test data is generated from Knora API and integrated automatically. + +Actual calls to the Knora API in production are mocked with `jasmine.Ajax`. +The data is read from the static test data files and passed to `jasmine.Ajax`, +so the component under test can react to it. + +If a component A depends on a component B, then B has to be mocked during the test using a `jasmine.Spy`. +The behavior of component B is simulated and a fake response is returned. +Mocking components turned out to be quite complex for the `OntologyCache`. +Therefore, the mock has been made a stand-alone testing component called `MockOntology` that can be reused. +It can also be used to generate static test data in software projects using this library. + +Since `MockOntology` is complex, some global assertions are made to guarantee that the mock behaves as the actual component. +These assertions are defined in `MockOntologyAssertions`. From 9a45f2bc4fee351d3dfc761fe0f8276ed3a96f5d Mon Sep 17 00:00:00 2001 From: Tobias Schweizer Date: Thu, 14 May 2020 15:30:56 +0200 Subject: [PATCH 10/10] chore (reformat code): auto format some code --- src/cache/OntologyCache.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cache/OntologyCache.spec.ts b/src/cache/OntologyCache.spec.ts index 7d298a460..51261fe3f 100644 --- a/src/cache/OntologyCache.spec.ts +++ b/src/cache/OntologyCache.spec.ts @@ -1,6 +1,6 @@ import { of } from "rxjs"; -import { MockOntology } from "../../test/data/api/v2/mockOntology"; import { MockOntologyAssertions } from "../../test/data/api/v2/mock-ontology-assertions"; +import { MockOntology } from "../../test/data/api/v2/mockOntology"; import { KnoraApiConfig } from "../knora-api-config"; import { KnoraApiConnection } from "../knora-api-connection"; import { ReadOntology } from "../models/v2/ontologies/read-ontology"; @@ -160,7 +160,7 @@ describe("OntologyCache", () => { describe("Method getResourceClass()", () => { - it("should get the definition of a resource class and its properties", done => { + it("should get the definition of a resource class and its properties", done => { knoraApiConnection.v2.ontologyCache.getResourceClassDefinition("http://0.0.0.0:3333/ontology/0001/anything/v2#Thing").subscribe( resClassDef => {