5

I am new to and I am using the JSON mappings to test some of the scenarios in my project.

In one of the test scenarios, I need to give response 200 OK after 2 retries(500) to the server which is trying to access one of the JSON mappings URL (say /retry).

I am able to achieve this by referring to the stateful behavior of http://wiremock.org/docs/stateful-behaviour/

But the problem is this it works only when one server or thread is accessing it. But if multiple server/instances/thread will try to access the same this will lead to inconsistent behavior as is changing the states internally.

So the query is how I make this scenario thread-safe to have consistent result?

P.S.: I am ready to move from JSON mapping to JAVA Usage of or even JUnits usage. But not sure if that will solve my problem. Also The Junit Usage I don't want to use because I am not doing this changes in my existing project in test module rather I am creating separate server to test independently.

0 Answers0