I am relatively new to Postman. I have a situation where we are testing endpoint calls to out back end. The processing of the endpoint call includes an endpoint call to a third party server. In some of tests we want to access the third party server. In other tests we want to mock the calls.
One possible solution is using Mountebank to create an impostor for the third party server. I know that will work, but that involves engaging and disengaging Mountebank outside of the test environment.
We would like to run the tests against a common test environment and I fear other users of the test environment would be affected by the impostor coming up and down in the background.
I am looking for a way to mock the third party server calls from Postman.
I did look at that document before I posted the question. I may have interpreted it incorrectly, but the mocking appeared to be mocking the response for the current request. My issue is that the call I want to mock is not the call I am testing. See the diagram below:
To process the request, the backend service makes a call to a third party API. I need to mock those calls.
The problem I am trying to solve is the transition between calling the third party server or using a mock server. I had hoped that we could drive the third party mocks from the test thus avoiding the transition.
We want to avoid putting mock-related code into the product code. Since we can accomplish this with Mountebank without modifying the product code, we will probably pursue that as a solution and live with the process to turn the Mountebank imposter on and off.
I am assuming that using a Postman mock server would involve some code changes to the back-end service. In the interest of completeness, I will look at the Postman Mocking doc to see what is involved.
I am doing a proof of concept on the mocking of embedded endpoint calls made during the processing of a Postman request. Can you point me to documentation on how to set it up. We are using a Java back-end. The calls to be mocked are from a java micro-service to a third party API.