Forum Discussion
JHunt
7 years agoCommunity Hero
Sure, you can just use Groovy Strings to do that:
String port = "8089"
def get = new URL("http://localhost:${port}/budg/inforeuro/api/public/monthly-rates").openConnection()
As for where to set the value for 'port', why not read it directly from the MockService itself?
String port = context.expand('${=project.getRestMockServiceByName("MockService").port}')
def get = new URL("http://localhost:${port}/budg/inforeuro/api/public/monthly-rates").openConnection()