Héctor
Héctor

Reputation: 13

Is it Possible to trigger request when request received by MockService (Onrequest Script)

I'm trying to automatically trigger a REST request with a groovy script "OnRequest Script" when my mockservice receives a request.

From "OnRequest Script" I have access to "log, context, mockRequest and mockRunner" variables.

How can I run a testStep or a TestCase from my mockService? Is it possible?

Can I create a new REST request in my mockService and send it?

Upvotes: 1

Views: 372

Answers (1)

ITemius
ITemius

Reputation: 881

You can create REST request using HTTPBuilder in groovy script.
Examples: get request, post request

Or you can use RESTClient - it is an extension of HTTPBuilder

Upvotes: 3

Related Questions