Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test-coverage: create negative tests for quoting service #95

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

AmTryingMyBest
Copy link
Contributor

@AmTryingMyBest AmTryingMyBest commented Jan 10, 2025

POST /quotes with missing headers
Send quote - wrong fspiop destination in header

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • error code should be '3102'
  • Response should contain fspiop-destination

Post Quote - Missing content header (BUG)

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • error code should be '3102'
  • Response should contain content header

Post Quote - Missing Accept header

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain Accept
  • error code should be '3102'

Post Quote - Missing Date header

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain date
  • error code should be '3102'

Post Quote - Missing FSPIOP Source header

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain fspiop
  • error code should be '3102'

POST /quotes with invalid values in header
Post Quote - Invalid FSPIOP Destination value

  • Response status to be 202
  • Response statusText be Accepted
  • Callback Content Length not 0
  • Callback FSP Destination equal to request FSP Source
  • Callback body should contain transferAmount
  • Request amountType to be SEND
  • Request transactionType scenario to be TRANSFER
  • Request transactionType initiator to be PAYER
  • Request transactionType initiatorType to be CONSUMER
  • Callback body should contain error information
  • Callback body should contain errorCode '3201'
  • Callback body should include Destination FSP error

Post Quote - Invalid content header (BUG)

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain '3101'

Post Quote - Invalid Accept header (BUG)

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain Accept
  • Response should contain '3101'

Post Quote - Invalid Date header (BUG) - skipped

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain date
  • Response should contain '3102'

POST /quotes with missing parameters in body
Post Quote - Missing quote ID in Body

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain quote
  • Response should contain '3100'

Post Quote - Missing transaction ID in body

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain transaction
  • Response should contain '3100'

Post Quote - Missing payer info in body

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain payer
  • Response should contain '3101'

Post Quote - Missing amount type in Body

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain amount
  • Response should contain '3100'

Post Quote - Missing amount in Body

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain amount
  • Response should contain '3100'

Post Quote - Missing currency in Body

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain currency
  • Response should contain '3100'

Post Quote - Missing transactionType-scenario in Body

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain transactionType
  • Response should contain '3100'

Post Quote - Missing transactionType-initiatorType in Body

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain transactionType
  • Response should contain '3100'

Post Quote - Missing transactionType-initiator in Body

  • Response status to be 400
  • Response statusText be Bad Request
  • Response should contain error information
  • Response should contain error code
  • Response should contain transactionType
  • Response should contain '3100'

POST /Quotes with wrong optional parameters and headers
Send Quote

  • Response status to be 202
  • Response statusText be Accepted
  • Callback Content Length not 0
  • Callback FSP Destination equal to request FSP Source
  • Callback body should contain transferAmount
  • Callback transferAmount (amount & currency)to match the request
  • Callback content-type to be quotes
  • Request amountType to be SEND
  • Request transactionType scenario to be TRANSFER
  • Request transactionType initiator to be PAYER
  • Request transactionType initiatorType to be CONSUMER
  • Response should not have error information

Post Quote with wrong optional parameter - name

  • Response status to be 202
  • Response statusText be Accepted
  • Callback Content Length not 0
  • Callback FSP Destination equal to request FSP Source
  • Callback body should contain transferAmount
  • Callback transferAmount (amount & currency)to match the request
  • Callback content-type to be quotes
  • Request amountType to be SEND
  • Request transactionType scenario to be TRANSFER
  • Request transactionType initiator to be PAYER
  • Request transactionType initiatorType to be CONSUMER
  • Response should not have error information

Post Quote with wrong optional header - HTTP Method

  • Response status to be 202
  • Response statusText be Accepted
  • Callback Content Length not 0
  • Callback FSP Destination equal to request FSP Source
  • Callback body should contain transferAmount
  • Callback transferAmount (amount & currency)to match the request
  • Callback content-type to be quotes
  • Request amountType to be SEND
  • Request transactionType scenario to be TRANSFER
  • Request transactionType initiator to be PAYER
  • Request transactionType initiatorType to be CONSUMER
  • Response should not have error information

@@ -1,6 +1,6 @@
{
"VERSION": 1,
"CALLBACK_ENDPOINT": "http://account-lookup-service:4002",
"CALLBACK_ENDPOINT": "http://example-users-api-service:8000",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shashi165 yes. This was the default or placeholder value, I had changed it to run the tests locally then unintentionally pushed the change in an earlier PR. This reverts that change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants