From a0cd7a0b264fa128bee442e0c6e65640d6a9c68d Mon Sep 17 00:00:00 2001 From: pasqualespica <36746022+pasqualespica@users.noreply.github.com> Date: Mon, 5 Feb 2024 10:31:56 +0100 Subject: [PATCH] fix integ test --- integration-test/src/config/.env.dev | 2 ++ integration-test/src/config/.env.local | 4 +++- integration-test/src/config/.env.uat | 2 ++ .../support/bizeventservice_client.js | 18 +++++++++++++----- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/integration-test/src/config/.env.dev b/integration-test/src/config/.env.dev index 7582e967..a44f6c22 100644 --- a/integration-test/src/config/.env.dev +++ b/integration-test/src/config/.env.dev @@ -1,4 +1,6 @@ BIZ_EVENTS_SERVICE_HOST=https://api.dev.platform.pagopa.it/bizevents/service/v1/ +BIZ_EVENTS_HELPDESK_HOST=https://api.dev.platform.pagopa.it/bizevents/helpdesk/v1/ +BIZ_EVENTS_TRXSRV_HOST=https://api.dev.platform.pagopa.it/bizevents/tx-service/v1/ COSMOS_DB_URI=https://pagopa-d-weu-bizevents-ds-cosmos-account.documents.azure.com:443/ COSMOS_DB_NAME=db COSMOS_DB_CONTAINER_NAME=biz-events diff --git a/integration-test/src/config/.env.local b/integration-test/src/config/.env.local index b1d8596b..0102bd7b 100644 --- a/integration-test/src/config/.env.local +++ b/integration-test/src/config/.env.local @@ -1,4 +1,6 @@ -BIZ_EVENTS_SERVICE_HOST=http://localhost:8080/ +BIZ_EVENTS_SERVICE_HOST= +BIZ_EVENTS_HELPDESK_HOST= +BIZ_EVENTS_TRXSRV_HOST= COSMOS_DB_URI=https://pagopa-d-weu-bizevents-ds-cosmos-account.documents.azure.com:443/ COSMOS_DB_NAME=db COSMOS_DB_CONTAINER_NAME=biz-events diff --git a/integration-test/src/config/.env.uat b/integration-test/src/config/.env.uat index 0aa73db7..815967bf 100644 --- a/integration-test/src/config/.env.uat +++ b/integration-test/src/config/.env.uat @@ -1,4 +1,6 @@ BIZ_EVENTS_SERVICE_HOST=https://api.uat.platform.pagopa.it/bizevents/service/v1/ +BIZ_EVENTS_HELPDESK_HOST=https://api.uat.platform.pagopa.it/bizevents/helpdesk/v1/ +BIZ_EVENTS_TRXSRV_HOST=https://api.uat.platform.pagopa.it/bizevents/tx-service/v1/ COSMOS_DB_URI=https://pagopa-u-weu-bizevents-ds-cosmos-account.documents.azure.com:443/ COSMOS_DB_NAME=db COSMOS_DB_CONTAINER_NAME=biz-events diff --git a/integration-test/src/step_definitions/support/bizeventservice_client.js b/integration-test/src/step_definitions/support/bizeventservice_client.js index 436e5d0e..7dd89fec 100644 --- a/integration-test/src/step_definitions/support/bizeventservice_client.js +++ b/integration-test/src/step_definitions/support/bizeventservice_client.js @@ -1,37 +1,45 @@ const { get, post } = require("./common"); const bizevents_service_host = process.env.BIZ_EVENTS_SERVICE_HOST; +const bizevents_helpdesk_host = process.env.BIZ_EVENTS_HELPDESK_HOST; +const bizevents_trxsrv_host = process.env.BIZ_EVENTS_TRXSRV_HOST; + +// is the same 4all function healthCheckInfo() { return get(bizevents_service_host + `info`, {}) } +// >>> BIZ_EVENTS_SERVICE_HOST function getOrganizationReceipt(organizationfiscalcode, iur, iuv) { return get(bizevents_service_host + `organizations/${organizationfiscalcode}/receipts/${iur}/paymentoptions/${iuv}`, {}) } +// >>> BIZ_EVENTS_HELPDESK_HOST function getBizEventById(id) { - return get(bizevents_service_host + `events/${id}`, {}) + return get(bizevents_helpdesk_host + `events/${id}`, {}) } + function getBizEventByOrgFiscalCodeAndIuv(organizationfiscalcode, iuv) { - return get(bizevents_service_host + `events/organizations/${organizationfiscalcode}/iuvs/${iuv}`, {}) + return get(bizevents_helpdesk_host + `events/organizations/${organizationfiscalcode}/iuvs/${iuv}`, {}) } +// >>> BIZ_EVENTS_TRXSRV_HOST function getTransactionListForUserWithFiscalCode(fiscalcode) { - return get(bizevents_service_host + `transactions?start=0&size=10`, { + return get(bizevents_trxsrv_host + `transactions?start=0&size=10`, { "x-fiscal-code": fiscalcode }) } function getTransactionWithIdForUserWithFiscalCode(id, fiscalcode) { - return get(bizevents_service_host + `transactions/${id}`, { + return get(bizevents_trxsrv_host + `transactions/${id}`, { "x-fiscal-code": fiscalcode }) } function disableTransactionWithIdForUserWithFiscalCode(id, fiscalcode) { - return post(bizevents_service_host + `transactions/${id}/disable`,"", { + return post(bizevents_trxsrv_host + `transactions/${id}/disable`,"", { "x-fiscal-code": fiscalcode }) }