title: Wiremock: Multiple responses for the same URL and content?
body: <p>Also shared here: <a href="https://github.com/tomakehurst/wiremock/issues/625" rel="noreferrer">https://github.com/tomakehurst/wiremock/issues/625</a></p>
  <p>I'm writing an integration test to verify that my application that interacts with a REST API handles unsuccessful requests appropriately. To do this, I'm wanting to simulate a scenario where a GET requests is made twice to a HTTP endpoint. First time, request is not successful with a response status code of 500; second time, request is successful with a response status code of 200.</p>
  <p>Consider the example below:</p>
  <pre class="lang-java prettyprint-override"><code>@Rule
  public WireMockRule wireMockRule 
          = new WireMockRule(wireMockConfig().dynamicPort().dynamicHttpsPort());
  
  @Test
  public void testRetryScenario(){
  
      // First StubMapping
      stubFor(get(urlEqualTo(&quot;/my/resource&quot;))
              .withHeader(&quot;Accept&quot;, equalTo(&quot;text/xml&quot;))
              .willReturn(aResponse()
                  .withStatus(500) // request unsuccessful with status code 500
                  .withHeader(&quot;Content-Type&quot;, &quot;text/xml&quot;)
                  .withBody(&quot;&lt;response&gt;Some content&lt;/response&gt;&quot;)));
  
      // Second StubMapping
      stubFor(get(urlEqualTo(&quot;/my/resource&quot;))
              .withHeader(&quot;Accept&quot;, equalTo(&quot;text/xml&quot;))
              .willReturn(aResponse()
                  .withStatus(200)  // request successful with status code 200
                  .withHeader(&quot;Content-Type&quot;, &quot;text/xml&quot;)
                  .withBody(&quot;&lt;response&gt;Some content&lt;/response&gt;&quot;)));
  
      //Method under test that makes calls to endpoint
      doSomething();
  
      Thread.sleep(5000);
  
      //Verify GET request was made again after first attempt
      verify(exactly(2), getRequestedFor(urlEqualTo(&quot;/my/resource&quot;)));
  
  }
  </code></pre>
  <p>Is there a way to avoid the second StubMapping from overriding the first -- to make sure that the first time <code>doSomething()</code> makes a request, <strong><em>a response with status code 500</em></strong> is returned, and the second time, <strong><em>a different response with status code 200</em></strong> is returned?</p>