Skip to content

Commit

Permalink
fix integ test
Browse files Browse the repository at this point in the history
  • Loading branch information
pasqualespica committed Feb 5, 2024
1 parent 0d9452d commit a0cd7a0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 2 additions & 0 deletions integration-test/src/config/.env.dev
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion integration-test/src/config/.env.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
BIZ_EVENTS_SERVICE_HOST=http://localhost:8080/
BIZ_EVENTS_SERVICE_HOST=<localhost>
BIZ_EVENTS_HELPDESK_HOST=<localhost>
BIZ_EVENTS_TRXSRV_HOST=<localhost>
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
Expand Down
2 changes: 2 additions & 0 deletions integration-test/src/config/.env.uat
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
})
}
Expand Down

0 comments on commit a0cd7a0

Please sign in to comment.