I found the below script to start and stop SOAP mock service. My requirement is to count the no.of hits for the mock and stop it once the hits count reach 3. The below script works fine to SOAP mock. But for rest mock this script doesn't work. Any idea how to start and stop REST Mock services using groovy script? I am aware of starting and stopping via maven plugin but it doesn't fir my requirement as I need to get the mock running count in my test steps.
def runner = testRunner.testCase.testSuite.project.mockServices["PFLUploadWebServiceMockService"].start() runner.clearResults() log.info "mock service started"