In the api that I need to test when I send a request I immediately receive a receive a response with a transactionID, no matter transaction succeeded or not. Along with my request I send a CallbackURL to the server where I expect the actual transaction result to be called back. The server will do a PUT request back to the CallbackURL that I have provided with the transactionID and the actual response or error.
So the question is, can I have such kind of scenarios in my postman tests?
I guess I should run a web server and expose an endpoint which will expect a PUT request and I should get the body of this PUT request in my tests to check it, and respond back to it with success.
In other words, within my script I need to perform the following actions:
- Do a request to the server passing a callback URL
- check the immediate response from the server and keep the returned transactionID
- Have a webserver run with and endpoint that I passed as a callback URL
- expect a request to that endpoint with transactionID and actual response
- Check that the response is what I actually expected
- Respond to the request with success
I was thinking about Postman Mock server, but seems it is not designed for such usage.
I also think may be I can run some JS webserver inside the postman sandbox…
Actually I am very new to postman testing and I am really confused about this kind of issue. Is it even possible to do this with postman or I need something else?