Skip to content

Commit

Permalink
Merge pull request #46 from pagopa/fix-get-receipt-message-integratio…
Browse files Browse the repository at this point in the history
…n-tests

fix: getReceiptMessage integration tests
  • Loading branch information
pasqualespica authored Jan 3, 2024
2 parents a8526b7 + 8194486 commit 442dfbd
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions integration-test/src/config/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RECEIPTS_COSMOS_CONN_STRING=<cosmos-connection-string>
RECEIPT_COSMOS_DB_NAME=db
RECEIPT_COSMOS_DB_CONTAINER_NAME=receipts
RECEIPT_ERROR_COSMOS_DB_CONTAINER_NAME=receipts-message-errors
RECEIPT_MESSAGE_COSMOS_DB_CONTAINER_NAME=receipts-io-messages

RECEIPTS_STORAGE_CONN_STRING=<storage-account-connection-string>
BLOB_STORAGE_CONTAINER_NAME=pagopa-d-weu-receipts-azure-blob-receipt-st-attach
Expand Down
1 change: 1 addition & 0 deletions integration-test/src/config/.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RECEIPTS_COSMOS_CONN_STRING=<cosmos-connection-string>
RECEIPT_COSMOS_DB_NAME=db
RECEIPT_COSMOS_DB_CONTAINER_NAME=receipts
RECEIPT_ERROR_COSMOS_DB_CONTAINER_NAME=receipts-message-errors
RECEIPT_MESSAGE_COSMOS_DB_CONTAINER_NAME=receipts-io-messages

RECEIPTS_STORAGE_CONN_STRING=<storage-account-connection-string>
BLOB_STORAGE_CONTAINER_NAME=pagopa-d-weu-receipts-azure-blob-receipt-st-attach
Expand Down
1 change: 1 addition & 0 deletions integration-test/src/config/.env.uat
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RECEIPTS_COSMOS_CONN_STRING=<cosmos-connection-string>
RECEIPT_COSMOS_DB_NAME=db
RECEIPT_COSMOS_DB_CONTAINER_NAME=receipts
RECEIPT_ERROR_COSMOS_DB_CONTAINER_NAME=receipts-message-errors
RECEIPT_MESSAGE_COSMOS_DB_CONTAINER_NAME=receipts-io-messages

RECEIPTS_STORAGE_CONN_STRING=<storage-account-connection-string>
BLOB_STORAGE_CONTAINER_NAME=pagopa-u-weu-receipts-azure-blob-receipt-st-attach
Expand Down
2 changes: 1 addition & 1 deletion integration-test/src/features/receipt_pdf_helpdesk.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Feature: All about payment events to recover managed by Azure functions receipt-

Scenario: getReceiptMessage API return receipt-error stored on datastore
Given a receipt-io-message with bizEventId "receipt-helpdesk-int-test-id-3" and messageId "receipt-helpdesk-int-test-message-id-3" stored into receipt-io-message datastore
When getReceiptMessage API is called with messageId "receipt-helpdesk-int-test-id-3"
When getReceiptMessage API is called with messageId "receipt-helpdesk-int-test-message-id-3"
Then the api response has a 200 Http status
And the receipt-message has messageId "receipt-helpdesk-int-test-message-id-3"
And the receipt-message has eventId "receipt-helpdesk-int-test-id-3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Then("wait {int} ms", async function (milliSec) {
sleep(milliSec)
});

Given('a receipt-io-message with bizEventId {string} and status {string} stored into receipt-error datastore', async function (eventId, messageId) {
Given('a receipt-io-message with bizEventId {string} and messageId {string} stored into receipt-io-message datastore', async function (eventId, messageId) {
messageId = messageId;
// prior cancellation to avoid dirty cases
await deleteDocumentFromReceiptMessageDatastore(messageId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function createDocumentInReceiptErrorDatastore(id, status) {
async function createDocumentInReceiptIoMessageDatastore(eventId, messageId) {
let message = createReceiptMessage(eventId, messageId);
try {
return await receiptMessageContainer.items.create(receipt);
return await receiptMessageContainer.items.create(message);
} catch (err) {
console.log(err);
}
Expand Down

0 comments on commit 442dfbd

Please sign in to comment.