Skip to content

Commit

Permalink
Adjust to new consumptionConfig to disable setting default Repository…
Browse files Browse the repository at this point in the history
…Attributes (#240)

* feat: adjust to runtime config to disable automated setting of default attributes

* refactor: rename test

* feat: adjust to ConsumptionController constructor adjustment

* chore: upgrade runtime

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
Milena-Czierlinski and mergify[bot] committed Aug 22, 2024
1 parent 531fffc commit 28015df
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 58 deletions.
114 changes: 58 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"@js-soft/node-logger": "1.2.0",
"@js-soft/ts-utils": "^2.3.3",
"@nmshd/iql": "^1.0.2",
"@nmshd/runtime": "5.0.0",
"@nmshd/runtime": "5.1.0",
"agentkeepalive": "4.5.0",
"amqplib": "^0.10.4",
"axios": "^1.7.4",
Expand Down
3 changes: 2 additions & 1 deletion src/ConnectorRuntime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ export class ConnectorRuntime extends Runtime<ConnectorRuntimeConfig> {

throw e;
});
const consumptionController = await new ConsumptionController(this.transport, this.accountController).init();

const consumptionController = await new ConsumptionController(this.transport, this.accountController, { setDefaultRepositoryAttributes: false }).init();

await this.checkDeviceCredentials(this.accountController);

Expand Down
15 changes: 15 additions & 0 deletions test/attributes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ describe("Attributes", () => {
expect(createAttributeResponse).toBeSuccessful(ValidationSchema.ConnectorAttribute);
});

test("should not set isDefault creating new RepositoryAttributes", async () => {
const repositoryAttribute = (
await client1.attributes.createRepositoryAttribute({
content: {
value: {
"@type": "Surname",
value: "ASurname"
}
}
})
).result;

expect(repositoryAttribute.isDefault).toBeUndefined();
});

test("should get the created attribute", async () => {
const attributeId = (
await client1.attributes.createRepositoryAttribute({
Expand Down

0 comments on commit 28015df

Please sign in to comment.