Skip to content

Commit

Permalink
Merge pull request #30 from pagopa/update-int-and-perf-test
Browse files Browse the repository at this point in the history
[PRDP-153] fix: Update biz event and receipt in integration and performance tests
  • Loading branch information
pasqualespica authored Oct 9, 2023
2 parents 545b739 + 1749055 commit 6856f9a
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 197 deletions.
213 changes: 78 additions & 135 deletions integration-test/src/step_definitions/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,6 @@ function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

function createEvent(id) {
let json_event = {
"id": id,
"version": "2",
"complete": "false",
"receiptId": "0095ff2bafec4bc0a719c9bf003aee4a",
"missingInfo": [
"idPaymentManager",
"psp.pspPartitaIVA",
"paymentInfo.primaryCiIncurredFee",
"paymentInfo.idBundle",
"paymentInfo.idCiBundle",
"paymentInfo.metadata"
],
"debtorPosition": {
"modelType": "2",
"noticeNumber": "302115802768026801",
"iuv": "02115802768026801"
},
"creditor": {
"idPA": "66666666666",
"idBrokerPA": "66666666666",
"idStation": "66666666666_01",
"companyName": "PA paolo",
"officeName": "office PA"
},
"psp": {
"idPsp": "POSTE3",
"idBrokerPsp": "BANCOPOSTA",
"idChannel": "POSTE3",
"psp": "Poste Italiane",
"pspFiscalCode": "CFPOSTE3",
"channelDescription": "app"
},
"debtor": {
"fullName": "John Doe",
"entityUniqueIdentifierType": "F",
"entityUniqueIdentifierValue": "JHNDOE00A01F205N",
"streetName": "street",
"civicNumber": "12",
"postalCode": "89020",
"city": "city",
"stateProvinceRegion": "MI",
"country": "IT",
"eMail": "[email protected]"
},
"payer": {
"fullName": "John Doe",
"entityUniqueIdentifierType": "F",
"entityUniqueIdentifierValue": "JHNDOE00A01F205S",
"streetName": "street",
"civicNumber": "12",
"postalCode": "89020",
"city": "city",
"stateProvinceRegion": "MI",
"country": "IT",
"eMail": "[email protected]"
},
"paymentInfo": {
"paymentDateTime": "2022-12-13T01:52:02.926587",
"applicationDate": "2021-10-01",
"transferDate": "2021-10-02",
"dueDate": "2021-07-31",
"paymentToken": "0095ff2bafec4bc0a719c9bf003aee4a",
"amount": "70.0",
"fee": "2.0",
"totalNotice": "1",
"paymentMethod": "creditCard",
"touchpoint": "app",
"remittanceInformation": "TARI 2021",
"description": "TARI 2021"
},
"transferList": [
{
"idTransfer": "1",
"fiscalCodePA": "77777777777",
"companyName": "Pa Salvo",
"amount": "70.0",
"transferCategory": "0101101IM",
"remittanceInformation": "TARI Comune EC_TE"
}
],
"eventStatus": "DONE",
"eventRetryEnrichmentCount": 0,
"_rid": "sMJGAMl3HZnqAQAAAAAAAA==",
"_self": "dbs/sMJGAA==/colls/sMJGAMl3HZk=/docs/sMJGAMl3HZnqAQAAAAAAAA==/",
"_etag": "\"2400e1e4-0000-0d00-0000-6397ccb60000\"",
"_attachments": "attachments/",
"_ts": 1670892726
}
return json_event
}

function createEventForQueue(id) {
return createEventForPoisonQueue(id, false);
}
Expand All @@ -103,86 +10,115 @@ function createEventForPoisonQueue(id, attemptedPoisonRetry) {
let json_event = {
"id": id,
"version": "2",
"idPaymentManager": "54927408",
"complete": "false",
"receiptId": "0095ff2bafec4bc0a719c9bf003aee4a",
"receiptId": "9851395f09544a04b288202299193ca6",
"attemptedPoisonRetry": attemptedPoisonRetry,
"missingInfo": [
"idPaymentManager",
"psp.pspPartitaIVA",
"paymentInfo.primaryCiIncurredFee",
"paymentInfo.idBundle",
"paymentInfo.idCiBundle",
"paymentInfo.metadata"
"paymentInfo.idCiBundle"
],
"debtorPosition": {
"modelType": "2",
"noticeNumber": "302115802768026801",
"iuv": "02115802768026801"
"noticeNumber": "310391366991197059",
"iuv": "10391366991197059"
},
"creditor": {
"idPA": "66666666666",
"idBrokerPA": "66666666666",
"idStation": "66666666666_01",
"idStation": "66666666666_08",
"companyName": "PA paolo",
"officeName": "office PA"
"officeName": "office"
},
"psp": {
"idPsp": "POSTE3",
"idBrokerPsp": "BANCOPOSTA",
"idChannel": "POSTE3",
"psp": "Poste Italiane",
"pspFiscalCode": "CFPOSTE3",
"idPsp": "60000000001",
"idBrokerPsp": "60000000001",
"idChannel": "60000000001_08",
"psp": "PSP Paolo",
"pspFiscalCode": "CF60000000006",
"channelDescription": "app"
},
"debtor": {
"fullName": "John Doe",
"entityUniqueIdentifierType": "F",
"fullName": "paGetPaymentName",
"entityUniqueIdentifierType": "G",
"entityUniqueIdentifierValue": "JHNDOE00A01F205N",
"streetName": "street",
"civicNumber": "12",
"postalCode": "89020",
"city": "city",
"stateProvinceRegion": "MI",
"streetName": "paGetPaymentStreet",
"civicNumber": "paGetPayment99",
"postalCode": "20155",
"city": "paGetPaymentCity",
"stateProvinceRegion": "paGetPaymentState",
"country": "IT",
"eMail": "john.doe@test.it"
"eMail": "paGetPayment@test.it"
},
"payer": {
"fullName": "John Doe",
"entityUniqueIdentifierType": "F",
"fullName": "name",
"entityUniqueIdentifierType": "G",
"entityUniqueIdentifierValue": "JHNDOE00A01F205S",
"streetName": "street",
"civicNumber": "12",
"postalCode": "89020",
"civicNumber": "civic",
"postalCode": "postal",
"city": "city",
"stateProvinceRegion": "MI",
"stateProvinceRegion": "state",
"country": "IT",
"eMail": "john.doe@test.it"
"eMail": "prova@test.it"
},
"paymentInfo": {
"paymentDateTime": "2022-12-13T01:52:02.926587",
"applicationDate": "2021-10-01",
"transferDate": "2021-10-02",
"dueDate": "2021-07-31",
"paymentToken": "0095ff2bafec4bc0a719c9bf003aee4a",
"amount": "70.0",
"paymentDateTime": "2023-03-17T16:37:36.955813",
"applicationDate": "2021-12-12",
"transferDate": "2021-12-11",
"dueDate": "2021-12-12",
"paymentToken": "9851395f09544a04b288202299193ca6",
"amount": "10.0",
"fee": "2.0",
"totalNotice": "1",
"paymentMethod": "creditCard",
"touchpoint": "app",
"remittanceInformation": "TARI 2021",
"description": "TARI 2021"
"description": "TARI 2021",
"metadata": [
{
"key": "1",
"value": "22"
}
]
},
"transferList": [
{
"idTransfer": "1",
"fiscalCodePA": "77777777777",
"companyName": "Pa Salvo",
"amount": "70.0",
"transferCategory": "0101101IM",
"remittanceInformation": "TARI Comune EC_TE"
"fiscalCodePA": "66666666666",
"companyName": "PA paolo",
"amount": "10.0",
"transferCategory": "paGetPaymentTest",
"remittanceInformation": "/RFB/00202200000217527/5.00/TXT/"
}
],
"eventStatus": "DONE"
"transactionDetails": {
"user": {
"fullName": "John Doe",
"type": "F",
"fiscalCode": "JHNDOE00A01F205N",
"notificationEmail": "[email protected]",
"userId": "1234",
"userStatus": "11",
"userStatusDescription": "REGISTERED_SPID"
},
"transaction": {
"idTransaction": 123456,
"transactionId": 123456,
"grandTotal": 0,
"amount": 0,
"fee": 0
}
},
"timestamp": 1679067463501,
"properties": {
"diagnostic-id": "00-f70ef3167cffad76c6657a67a33ee0d2-61d794a75df0b43b-01",
"serviceIdentifier": "NDP002SIT"
},
"eventStatus": "DONE",
"eventRetryEnrichmentCount": 0
}
return json_event
}
Expand All @@ -193,7 +129,14 @@ function createReceipt(id) {
"eventId": id,
"eventData": {
"payerFiscalCode": "JHNDOE00A01F205N",
"debtorFiscalCode": "JHNDOE00A01F205N"
"debtorFiscalCode": "JHNDOE00A01F205N",
"amount": "200",
"cart": [
{
"payeeName": "Comune di Milano",
"subject": "ACI"
}
]
},
"status": "INSERTED",
"numRetry": 0,
Expand All @@ -208,5 +151,5 @@ function createReceipt(id) {
}

module.exports = {
createEvent, sleep, createReceipt, createEventForPoisonQueue, createEventForQueue
sleep, createReceipt, createEventForPoisonQueue, createEventForQueue
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const assert = require('assert');
const { After, Given, When, Then, setDefaultTimeout } = require('@cucumber/cucumber');
const { sleep, createEventForQueue, createEventForPoisonQueue } = require("./common");
const { getDocumentByIdFromReceiptsDatastore, deleteDocumentFromErrorReceiptsDatastoreByMessagePayload, deleteDocumentFromReceiptsDatastoreByEventId, deleteDocumentFromReceiptsDatastore, createDocumentInReceiptsDatastore, createDocumentInErrorReceiptsDatastore, deleteDocumentFromErrorReceiptsDatastore, getDocumentByMessagePayloadFromErrorReceiptsDatastore } = require("./receipts_datastore_client");
const { getDocumentByIdFromReceiptsDatastore, deleteDocumentFromErrorReceiptsDatastoreByMessagePayload, deleteDocumentFromReceiptsDatastore, createDocumentInReceiptsDatastore, createDocumentInErrorReceiptsDatastore, deleteDocumentFromErrorReceiptsDatastore, getDocumentByMessagePayloadFromErrorReceiptsDatastore } = require("./receipts_datastore_client");
const { putMessageOnPoisonQueue, putMessageOnReceiptQueue } = require("./reqeipt_queue_client");
const { receiptPDFExist } = require("./receipts_blob_storage_client");

Expand Down
Loading

0 comments on commit 6856f9a

Please sign in to comment.