Skip to content

Dymanic reaponse based on the request #7

@paramadeep

Description

@paramadeep

Should be able to populate response based on the request components.

Say for example, when a service talk to a payment gateway, the transaction id is generated dynamically by the application and the transaction id expected expected as part of the response say the response body.

In the above scenario, test will not be able to configure this, using Poisol as the test will not have the value of the transaction id that the application will generate. Here we need to create a provision to create in config where in response can fetch value from request.

request:
  url: payment/{trans_id | .*}
  query: 
    total_amount: "[0-9]+"
response:
  body:'{
          amount : <<trans_id>>
          trans_id:  <<total_amount>>
           status: "success"
        }'

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions