Ask a Question

Is it possible to simulate a 500 or other non-200 response with AutoMocking?

WilliamWilliams
Occasional Contributor

Is it possible to simulate a 500 or other non-200 response with AutoMocking?

In order to test my api in SwaggerHub it'd be nice to simulate the response for a 500, 201, 400, etc and make sure that the format of the response is what I expect.  Is this possible?  When I try a new integration and set up automock that option isn't shown.

Thank you!

2 REPLIES 2
chichepo
Frequent Contributor

Hi @WilliamWilliams 

Just wondering if commenting the 200 response is enough? When trying it, you should get the error message first.

chichepo_0-1679598773314.png

 

WilliamWilliams
Occasional Contributor

Unfortunately not.  If I do like you did above the response just says "undocumented" above the previous 200 response.  Or I get a 406 error.  I would need the mocked up server code to throw a 500.  Not sure exactly how they implement that mocking functionality.  

cancel
Showing results for 
Search instead for 
Did you mean: