Service Virtualization

 View Only
  • 1.  How to Virtualize Array of Request

    Posted Aug 02, 2020 05:28 PM
    Hi,

    i have request and response files with Array of accounts in Request and Array of accounts in Responce.
    we are using Postman to run the request and responses
    How can i achieve when i give 1account in the request body and get appropriate account result in Response instead whole response
    Please let me know your thoughts, Request and Response files are attached

    What i am expecting is : 
    Scenario 1:
    {
    "customerAccountItems": {
    "1": {
    "accountReference": {
    "hoganProductCode": "DDA",
    "accountNumber": "1003853684"
    },
    "accountReferenceKeyedIndicators": {
    "accountNumberKeyedIndicator": true
    },
    "itemTypeInfo": {
    "postingParameterCode": "BALANCE_INQUIRY"
    }
    }
    }
    }

    Scenario 2:
    {
    "customerAccountItems": {
    "1": {
    "accountReference": {
    "hoganProductCode": "DDA",
    "accountNumber": "1003853684"
    },
    "accountReferenceKeyedIndicators": {
    "accountNumberKeyedIndicator": true
    },
    "itemTypeInfo": {
    "postingParameterCode": "BALANCE_INQUIRY"
    }
    },
    "4": {
    "accountReference": {
    "hoganProductCode": "DDA",
    "accountNumber": "1003853684"
    },
    "accountReferenceKeyedIndicators": {
    "accountNumberKeyedIndicator": true
    },
    "itemTypeInfo": {
    "postingParameterCode": "BALANCE_INQUIRY"
    }
    }
    }
    }

    Note: FIles are not in correct format


    Attachment(s)

    txt
    getBalanceInquiry-rsp.txt   11 KB 1 version
    txt
    getBalanceInquiry-req.txt   1 KB 1 version


  • 2.  RE: How to Virtualize Array of Request

    Posted Aug 03, 2020 12:53 AM
    Hi Rakesh,

    You can put = condition on account number in vsi to have specific responses for different account numbers.

    Thanks

    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------



  • 3.  RE: How to Virtualize Array of Request

    Posted Aug 03, 2020 07:03 AM
    Hi Vaibhav,
    Thanks for reply.
    Here account number and all other values are not static, so values can be dynamic and same values have to come in response. Again in the request body i want to send limited arguments (mandatory arguments) instead all. 
    for the one your said = (equal to) in regular property, i used it i want only that part from response array, but here i am getting all response body.
    is there way to retrieve only that part ?


  • 4.  RE: How to Virtualize Array of Request

    Posted Aug 03, 2020 07:10 AM
    Hi Rakesh,

    You can try creating multiple R-R pairs for different data combinations to cater your need.

    For replicating the request values in responses, you can use magic strings.

    Thanks

    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------



  • 5.  RE: How to Virtualize Array of Request

    Posted Aug 03, 2020 08:21 AM
    is this the only way ?
    what if i have lot of combinations ?


  • 6.  RE: How to Virtualize Array of Request
    Best Answer

    Posted Aug 03, 2020 08:31 AM
    Hi Rakesh,

    The other way to achieve is to read the message and identify the number of accounts present. Once that is done, you have to write a script to get the relevant values from each block and prepare a response section (1 resp section for each account present in request). At last, you can combine the whole response and send it accordingly.

    Thanks

    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------