AnsweredAssumed Answered

Virtualization of a GET serevice with dynamic response

Question asked by wmlisa on Feb 25, 2015
Latest reply on Dec 15, 2015 by abrsh01

GET service : http://host:port/external-services/resources/facilities?countryCode=US&facilityNbrs=5562,5550,5594

 

Response: Facility details are in a json array. This array is dynamic based in the facilityNbrs in the the input. if there are 3 facilitynbr, response give 3 jsons in an array.

{

    "facilities": [

        {

            "facilityNbr": 5562,

            "facilityDesc": "desc",

        },

        {

            "facilityNbr": 5550,

            "facilityDesc": "BENTONVILLE, AR",

        },

        {

            "facilityNbr": 5594,

            "facilityDesc": "ROGERS, AR",

        }

    ]

}

 

Question is how to mock dynamic response in Lisa. While record i recorded with 1 facility nbr, it has one json object in the array. how to automate the response details. Is there any for loop in the response that i can put in the body based on the facilitynbrs? is it possible?

Outcomes