From ac77f6b0ceafe901759eede6a10deb832a567184 Mon Sep 17 00:00:00 2001 From: giomella Date: Wed, 17 Jan 2024 17:44:31 +0100 Subject: [PATCH] [PRDP-318] format code --- .../support/bizeventservice_client.js | 16 +++---- .../support/organizationsreceipt_steps.js | 46 +++++++++---------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/integration-test/src/step_definitions/support/bizeventservice_client.js b/integration-test/src/step_definitions/support/bizeventservice_client.js index 05d5f6ca..ee5a824a 100644 --- a/integration-test/src/step_definitions/support/bizeventservice_client.js +++ b/integration-test/src/step_definitions/support/bizeventservice_client.js @@ -1,37 +1,37 @@ -const {get} = require("./common"); +const { get } = require("./common"); const bizevents_service_host = process.env.BIZ_EVENTS_SERVICE_HOST; function healthCheckInfo() { - return get(bizevents_service_host+`info`, {}) + return get(bizevents_service_host + `info`, {}) } function getOrganizationReceipt(organizationfiscalcode, iur, iuv) { - return get(bizevents_service_host+`organizations/${organizationfiscalcode}/receipts/${iur}/paymentoptions/${iuv}`, {}) + return get(bizevents_service_host + `organizations/${organizationfiscalcode}/receipts/${iur}/paymentoptions/${iuv}`, {}) } function getBizEventById(id) { - return get(bizevents_service_host+`events/${id}`, {}) + return get(bizevents_service_host + `events/${id}`, {}) } function getBizEventByOrgFiscalCodeAndIuv(organizationfiscalcode, iuv) { - return get(bizevents_service_host+`events/organizations/${organizationfiscalcode}/iuvs/${iuv}`, {}) + return get(bizevents_service_host + `events/organizations/${organizationfiscalcode}/iuvs/${iuv}`, {}) } function getTransactionListForUserWithFiscalCode(fiscalcode) { - return get(bizevents_service_host+`transactions?start=0&size=10`, { + return get(bizevents_service_host + `transactions?start=0&size=10`, { "x-fiscal-code": fiscalcode }) } function getTransactionWithIdForUserWithFiscalCode(id, fiscalcode, isCart) { - return get(bizevents_service_host+`transactions/${id}?isCart=${isCart}`, { + return get(bizevents_service_host + `transactions/${id}?isCart=${isCart}`, { "x-fiscal-code": fiscalcode }) } module.exports = { - healthCheckInfo, + healthCheckInfo, getOrganizationReceipt, getBizEventById, getBizEventByOrgFiscalCodeAndIuv, diff --git a/integration-test/src/step_definitions/support/organizationsreceipt_steps.js b/integration-test/src/step_definitions/support/organizationsreceipt_steps.js index d8ad3d40..56b8c023 100644 --- a/integration-test/src/step_definitions/support/organizationsreceipt_steps.js +++ b/integration-test/src/step_definitions/support/organizationsreceipt_steps.js @@ -1,9 +1,9 @@ const assert = require('assert') -const {Given, When, Then, setDefaultTimeout, After} = require('@cucumber/cucumber') -const {getOrganizationReceipt, getBizEventById, getBizEventByOrgFiscalCodeAndIuv, getTransactionListForUserWithFiscalCode, getTransactionWithIdForUserWithFiscalCode} = require("./bizeventservice_client"); -const {createDocument, deleteDocument} = require("./cosmosdb_client"); -const {createEvent, makeId} = require("./common"); -const {createDocumentInBizEventsDatastore, deleteDocumentFromBizEventsDatastore} = require("./biz_events_cosmosdb_client"); +const { Given, When, Then, setDefaultTimeout, After } = require('@cucumber/cucumber') +const { getOrganizationReceipt, getBizEventById, getBizEventByOrgFiscalCodeAndIuv, getTransactionListForUserWithFiscalCode, getTransactionWithIdForUserWithFiscalCode } = require("./bizeventservice_client"); +const { createDocument, deleteDocument } = require("./cosmosdb_client"); +const { createEvent, makeId } = require("./common"); +const { createDocumentInBizEventsDatastore, deleteDocumentFromBizEventsDatastore } = require("./biz_events_cosmosdb_client"); const BIZ_ID = "biz-event-service-int-test-transaction-"; @@ -16,14 +16,14 @@ setDefaultTimeout(360 * 1000); // After each Scenario After(async function () { - // remove event - if(bizEventList.length > 0){ - for(let bizEvent of bizEventList){ - await deleteDocumentFromBizEventsDatastore(bizEvent.id); - } - } - - responseToCheck = null; + // remove event + if (bizEventList.length > 0) { + for (let bizEvent of bizEventList) { + await deleteDocumentFromBizEventsDatastore(bizEvent.id); + } + } + + responseToCheck = null; receipt = null; bizEvent = null; bizEventList = []; @@ -87,14 +87,14 @@ Then('the details of the Biz-Event are returned to the operator with id {string} Given('{int} Biz-Event with debtor fiscal code {string}', (numberOfEvents, debtorFiscalCode) => { for (let i = 0; i < numberOfEvents; i++) { - bizEventList.push(createEvent(BIZ_ID + i + makeId(4), undefined, undefined, debtorFiscalCode)) - } + bizEventList.push(createEvent(BIZ_ID + i + makeId(4), undefined, undefined, debtorFiscalCode)) + } }) Given('{int} Biz-Event with payer fiscal code {string}', (numberOfEvents, payerFiscalCode) => { for (let i = 0; i < numberOfEvents; i++) { - bizEventList.push(createEvent(BIZ_ID + i + makeId(4), undefined, undefined, undefined, payerFiscalCode)) - } + bizEventList.push(createEvent(BIZ_ID + i + makeId(4), undefined, undefined, undefined, payerFiscalCode)) + } }) Given('Save all on Cosmos DB', async () => { @@ -112,24 +112,24 @@ When('the user with fiscal code {string} asks for its transactions', async (fisc Then('the user gets the status code {int}', (status) => { assert.strictEqual(responseToCheck.status, status); }) - + Then('the user gets {int} transactions', (totalTransactions) => { assert.strictEqual(responseToCheck.data.length, totalTransactions); }) Given('{int} cart Biz-Event with transactionId {string}, debtor fiscal code {string} and amount {int}', (numberOfEvents, transactionId, debtorFiscalCode, amount) => { for (let i = 0; i < numberOfEvents; i++) { - bizEventList.push(createEvent(i + makeId(10), transactionId, numberOfEvents, debtorFiscalCode, undefined, amount)) - } + bizEventList.push(createEvent(i + makeId(10), transactionId, numberOfEvents, debtorFiscalCode, undefined, amount)) + } }) Then('one of the transactions is a cart with id {string} and amount {bigdecimal}', (transactionId, amount) => { let found = false; for (let transaction of responseToCheck.data) { if (transaction.transactionId == transactionId) { - assert.strictEqual(transaction.amount, amount); - found = true; - } + assert.strictEqual(transaction.amount, amount); + found = true; + } } assert.strictEqual(found, true); })