I have a use case where I want to mock an API /register
that returns some date but then also calls another REST API from another service after it returns data to this request.
The feature file looks something like this:
Scenario: pathMatches('/register')
* def responseStatus = 200
* def response = { registerId: '1234' }
# do the callback request after the response is returned
* karate.http('http://someservice.com/callback').get()
But this does not work in Karate as it runs synchronously. I also tried to create a new thread but this is not supported by GraalJS and throws an Exception.
Is there some other way to do this?