Adding additiona query parameters to the request via ServiceV option “Route Non Virtualized Request"
We are facing issue with the routing scenario of the ServiceV option “Route Non Virtualized Request”.
As per our requirement once the virtual service receives the request, we have to add an additional query parameter and then route live system.
However, we are seeing the query parameters are getting repeated.
Below is the example:
Request sent to virtual service: POST http://localhost:8090/oauth2?username=ABCD&password=Test123
As per the requirement we have to add this additional parameter: env=ENV1 to query string
Therefore while routing the ServiceV should do the routing as http://LIVE HOST:PORT/oauth2?username=ABCD&password=Test123&env=ENV1
However, we are seeing double query parameters being sent.
I was able to move ahead by adding the below event
MockRunListener.beforeRoute and added the below script, the routing is working as expected.
method.setURI(URI.create(method.getURI().toString() + "&enviornment=ENV1"))
Thanks Temil for providing the solution