Forum Discussion
You can try to set "Route to" value to property expansion and then change it in your script. For example you can set "Route to" is set to ${#MockService#route_endpoint}, and then you can add to your script:
Thank you for your resoponse.
I changed the option to "Route To" and set the value to property expansion as ${#MockService#route_endpoint}.
However, I am getting 404. Even I tried to just put the value as the complete URL, however, I am seeing 404.
And also the script is not getting invoked when I have set the option as "Conditional"
if (! mockRequest.path.contains('/oauth2'))
return false // do not route the request
mockRequest.queryString += '&env=ENV1'
mockRunner.getMockContext().mockService.setPropertyValue("route_endpoint","https:/HOSTNAME/oauth2?mockRequest.queryString")
log.info 'DEBUG: Modified query string - ' + mockRequest.queryString
return true // route the request