Skip to content

Commit

Permalink
new test new mod3
Browse files Browse the repository at this point in the history
  • Loading branch information
DamDory committed Aug 2, 2022
1 parent a94a0b0 commit 1132f65
Showing 1 changed file with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Feature: semantic check for activatePaymentNotice regarding idempotency

Background:
Given systems up
And nodo-dei-pagamenti has config parameter useIdempotency set to true

Scenario: Execute activatePaymentNotice request
Given initial XML activatePaymentNotice
"""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nod="http://pagopa-api.pagopa.gov.it/node/nodeForPsp.xsd">
<soapenv:Header/>
<soapenv:Body>
<nod:activatePaymentNoticeReq>
<idPSP>70000000001</idPSP>
<idBrokerPSP>70000000001</idBrokerPSP>
<idChannel>70000000001_01</idChannel>
<password>pwdpwdpwd</password>
<idempotencyKey>#idempotency_key#</idempotencyKey>
<qrCode>
<fiscalCode>#creditor_institution_code_old#</fiscalCode>
<noticeNumber>#notice_number_old#</noticeNumber>
</qrCode>
<expirationTime>2000</expirationTime>
<amount>10.00</amount>
<paymentNote>causale</paymentNote>
</nod:activatePaymentNoticeReq>
</soapenv:Body>
</soapenv:Envelope>
"""
When PSP sends SOAP activatePaymentNotice to nodo-dei-pagamenti
Then check outcome is OK of activatePaymentNotice response

Scenario: Execute activatePaymentNotice1 request
Given the Execute activatePaymentNotice request scenario executed successfully
And PSP waits 4 seconds for expiration
And initial XML activatePaymentNotice
"""
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:nod="http://pagopa-api.pagopa.gov.it/node/nodeForPsp.xsd">
<soapenv:Header/>
<soapenv:Body>
<nod:activatePaymentNoticeReq>
<idPSP>70000000001</idPSP>
<idBrokerPSP>70000000001</idBrokerPSP>
<idChannel>70000000001_01</idChannel>
<password>pwdpwdpwd</password>
<idempotencyKey>$activatePaymentNotice.idempotencyKey</idempotencyKey>
<qrCode>
<fiscalCode>$activatePaymentNotice.fiscalCode</fiscalCode>
<noticeNumber>$activatePaymentNotice.noticeNumber</noticeNumber>
</qrCode>
<amount>10.00</amount>
<paymentNote>causale</paymentNote>
</nod:activatePaymentNoticeReq>
</soapenv:Body>
</soapenv:Envelope>
"""
When PSP sends SOAP activatePaymentNotice to nodo-dei-pagamenti
Then check outcome is KO of activatePaymentNotice response
And check faultCode is PPT_PAGAMENTO_IN_CORSO of activatePaymentNotice response

#DB check
Scenario: DB check1
Given the Execute activatePaymentNotice request scenario executed successfully
And check datetime plus number of date 0 of the record at column VALID_TO of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column ID of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value $activatePaymentNotice.fiscalCode of the record at column PA_FISCAL_CODE of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value activatePaymentNotice of the record at column PRIMITIVA of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value $activatePaymentNotice.idPSP of the record at column PSP_ID of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value $activatePaymentNotice.noticeNumber of the record at column NOTICE_ID of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value $activatePaymentNotice.idempotencyKey of the record at column IDEMPOTENCY_KEY of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value $activatePaymentNoticeResponse.paymentToken of the record at column TOKEN of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column HASH_REQUEST of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column RESPONSE of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3
And checks the value NotNone of the record at column INSERTED_TIMESTAMP of the table IDEMPOTENCY_CACHE retrived by the query idempotency_cache_act on db nodo_online under macro NewMod3

0 comments on commit 1132f65

Please sign in to comment.