From 2f7d21b22f6bc0d413117bd1966bb2a9c01e4bcf Mon Sep 17 00:00:00 2001 From: Sebastian Mahr Date: Tue, 3 Dec 2024 15:33:51 +0100 Subject: [PATCH] chore: rename backbone attrubte tag --- .../src/modules/attributes/AttributesController.ts | 6 +++--- .../modules/attributes/AttributeTagCollection.test.ts | 8 ++++---- .../test/consumption/attributeTagCollection.test.ts | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/consumption/src/modules/attributes/AttributesController.ts b/packages/consumption/src/modules/attributes/AttributesController.ts index c2b600019..062e64c59 100644 --- a/packages/consumption/src/modules/attributes/AttributesController.ts +++ b/packages/consumption/src/modules/attributes/AttributesController.ts @@ -46,7 +46,7 @@ import { IdentityAttributeQueryTranslator, RelationshipAttributeQueryTranslator, export class AttributesController extends ConsumptionBaseController { private attributes: SynchronizedCollection; - private tagsClient: AttributeTagClient; + private attributeTagClient: AttributeTagClient; public constructor( parent: ConsumptionController, @@ -61,7 +61,7 @@ export class AttributesController extends ConsumptionBaseController { await super.init(); this.attributes = await this.parent.accountController.getSynchronizedCollection("Attributes"); - this.tagsClient = new AttributeTagClient(this.parent.transport.config, this.parent.accountController.authenticator, this.parent.transport.correlator); + this.attributeTagClient = new AttributeTagClient(this.parent.transport.config, this.parent.accountController.authenticator, this.parent.transport.correlator); return this; } @@ -1295,7 +1295,7 @@ export class AttributesController extends ConsumptionBaseController { } public async getAttributeTagCollection(): Promise { - const backboneTagList = (await this.tagsClient.getBackboneAttributeTagCollection()).value; + const backboneTagList = (await this.attributeTagClient.getBackboneAttributeTagCollection()).value; return AttributeTagCollection.fromAny(backboneTagList); } } diff --git a/packages/consumption/test/modules/attributes/AttributeTagCollection.test.ts b/packages/consumption/test/modules/attributes/AttributeTagCollection.test.ts index 7d0103464..b686f8dce 100644 --- a/packages/consumption/test/modules/attributes/AttributeTagCollection.test.ts +++ b/packages/consumption/test/modules/attributes/AttributeTagCollection.test.ts @@ -1,5 +1,5 @@ import { IDatabaseConnection } from "@js-soft/docdb-access-abstractions"; -import { AccountController, ClientResult, TagClient, Transport } from "@nmshd/transport"; +import { AccountController, AttributeTagClient, ClientResult, Transport } from "@nmshd/transport"; import { spy, when } from "ts-mockito"; import { ConsumptionController } from "../../../src"; import { TestUtil } from "../../core/TestUtil"; @@ -12,7 +12,7 @@ describe("AttributeTagCollection", function () { let consumptionController: ConsumptionController; let accountController: AccountController; - let mockedClient: TagClient; + let mockedClient: AttributeTagClient; /* eslint-disable @typescript-eslint/naming-convention */ const mockTags = { @@ -59,7 +59,7 @@ describe("AttributeTagCollection", function () { const accounts = await TestUtil.provideAccounts(transport, 1); ({ consumptionController, accountController } = accounts[0]); - const client = consumptionController.attributes["tagsClient"]; + const client = consumptionController.attributes["attributeTagClient"]; mockedClient = spy(client); }); @@ -70,7 +70,7 @@ describe("AttributeTagCollection", function () { }); test("should receive the legal tags from the Backbone", async function () { - when(mockedClient.getTags()).thenResolve(ClientResult.ok(mockTags)); + when(mockedClient.getBackboneAttributeTagCollection()).thenResolve(ClientResult.ok(mockTags)); const tags = await consumptionController.attributes.getAttributeTagCollection(); expect(tags.toJSON()).toStrictEqualExcluding(mockTags, "@type"); diff --git a/packages/runtime/test/consumption/attributeTagCollection.test.ts b/packages/runtime/test/consumption/attributeTagCollection.test.ts index 922044be6..b749ca7f8 100644 --- a/packages/runtime/test/consumption/attributeTagCollection.test.ts +++ b/packages/runtime/test/consumption/attributeTagCollection.test.ts @@ -1,15 +1,15 @@ -import { ClientResult, DefinedTagClient } from "@nmshd/transport"; +import { AttributeTagClient, ClientResult } from "@nmshd/transport"; import { reset, spy, when } from "ts-mockito"; import { RuntimeServiceProvider, TestRuntimeServices } from "../lib"; const serviceProvider = new RuntimeServiceProvider(); let runtimeService: TestRuntimeServices; -let mockedRestClient: DefinedTagClient; +let mockedRestClient: AttributeTagClient; beforeAll(async () => { runtimeService = (await serviceProvider.launch(1))[0]; - const client = runtimeService.consumption.attributes["getAttributeTagCollectionUseCase"]["attributesController"]["tagsClient"] as DefinedTagClient; + const client = runtimeService.consumption.attributes["getAttributeTagCollectionUseCase"]["attributesController"]["attributeTagClient"] as AttributeTagClient; mockedRestClient = spy(client); }, 30000); @@ -57,7 +57,7 @@ describe("get attributeTagCollection", function () { /* eslint-enable @typescript-eslint/naming-convention */ test("should receive the legal tags from the Backbone", async function () { - when(mockedRestClient.getBackboneDefinedTags()).thenResolve(ClientResult.ok(mockTags)); + when(mockedRestClient.getBackboneAttributeTagCollection()).thenResolve(ClientResult.ok(mockTags)); const tags = await runtimeService.consumption.attributes.getAttributeTagCollection(); expect(tags.value).toStrictEqual(mockTags);