title: How to make wiremock stateful behaviour thread-safe?
body: <p>I am new to <a href="/questions/tagged/wiremock" class="post-tag" title="show questions tagged &#39;wiremock&#39;" rel="tag">wiremock</a> and I am using the <a href="/questions/tagged/wiremock" class="post-tag" title="show questions tagged &#39;wiremock&#39;" rel="tag">wiremock</a> JSON mappings to test some of the scenarios in my project. </p>
  
  <p>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).</p>
  
  <p>I am able to achieve this by referring to the stateful behavior of <a href="/questions/tagged/wiremock" class="post-tag" title="show questions tagged &#39;wiremock&#39;" rel="tag">wiremock</a> <a href="http://wiremock.org/docs/stateful-behaviour/" rel="noreferrer">http://wiremock.org/docs/stateful-behaviour/</a></p>
  
  <p>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 <a href="/questions/tagged/wiremock" class="post-tag" title="show questions tagged &#39;wiremock&#39;" rel="tag">wiremock</a>is changing the states internally.</p>
  
  <p>So the query is how I make this scenario thread-safe to have consistent result?</p>
  
  <p>P.S.: I am ready to move from JSON mapping to JAVA Usage of <a href="/questions/tagged/wiremock" class="post-tag" title="show questions tagged &#39;wiremock&#39;" rel="tag">wiremock</a> 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 <a href="/questions/tagged/wiremock" class="post-tag" title="show questions tagged &#39;wiremock&#39;" rel="tag">wiremock</a>server to test independently.</p>