Service Virtualization

 View Only
  • 1.  Magic string for GET request

    Posted Aug 19, 2020 02:08 PM
    Hi,

    We have a requirement for GET request which has a property called "riskUnit" and the values would be 0001 to 0007 based on the values in the request URL it should return the response for particular riskUnit ID.

    For Example: 
    http://localhost:7600/api/v1/insurancePolicies/100205985CTC?effectiveDate=2020-05-21&businessTypeCode=B7%20CP&productCode=CTC&sourceSystem=PO&riskUnit=0002,0003&expandedView=product,agencies,insurers,policyHolders,endorsements,covers,riskUnits

    As I am passing 0002 and 0003 it should return the response for only that values.

    Response structure:
    "riskUnits":[{
    "riskUnitId":"1",
    "categoryCode":"0000000",
    "subCategoryCode":"xxxxxxxxxxxxxxxxxxx",
    "description":"yyyyyyyyyyyyyyyyyyy",
    "address":{
    "postcode":"zzzzzzz",
    "countryCode":"1234"
    }

    Expected scenarios like combination of any values from 1 to 7(for ex. (0002,0003) or (0001 to 0007) or 0003 )

    Could you please help how can we achieve this using magic string.

    Thanks,
    Mohammed Sheeraz


  • 2.  RE: Magic string for GET request

    Posted Aug 20, 2020 01:26 AM
    Please try fetching the attributes of the request URL via lisa.vse.request and then using those in response.

    ------------------------------
    Regards
    Sonali
    ------------------------------



  • 3.  RE: Magic string for GET request

    Posted Aug 20, 2020 02:31 AM
    Hi Mohammed,

    As these are passed as querystring parameter, you can use them in script to manipulate the values. Unfortunately, i am not able to understand your problem statement completely, but i believe using the matching condition in VSI (regex) you can still achieve the expected outcome.

    Thanks

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