title: Failing initial response when updating test via Zephyr api
body: <p>I am having some issues regarding updating an execution status in a zephyr test cycle, this implementation has been present for a year and the failure has only just started occurring, when we run our set of selenium tests, the first test will fail to update the test execution status with the following error:</p>
  <pre><code>java.lang.AssertionError: 1 expectation failed.
  </code></pre>
  <p>Expected status code &lt;200&gt; but was &lt;404&gt;.</p>
  <pre><code>at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
  at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
  at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
  at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
  at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
  at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:277)
  at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.validate(ResponseSpecificationImpl.groovy:499)
  at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure$validate$1.call(Unknown Source)
  at io.restassured.internal.ResponseSpecificationImpl.validateResponseIfRequired(ResponseSpecificationImpl.groovy:684)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
  at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.base/java.lang.reflect.Method.invoke(Method.java:568)
  at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
  at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:193)
  at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:61)
  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
  at io.restassured.internal.ResponseSpecificationImpl.statusCode(ResponseSpecificationImpl.groovy:127)
  at io.restassured.specification.ResponseSpecification$statusCode$0.callCurrent(Unknown Source)
  </code></pre>
  <p>After the first test has failed, all other tests successfully update the status, If I put the code into debug and step through the updateTestResult method then it is able to update the status, so it looks like a timing issue in my opinion, however I am not sure how I can handle that delay with our current implementation, Method is below:</p>
  <pre><code>public void updateTestResult(boolean isTestFailed) {
      String body;
      if (isTestFailed) {
          body = &quot;{\n&quot; +
                  &quot;    \&quot;status\&quot;: \&quot;2\&quot;\n&quot; +
                  &quot;}&quot;;
      } else {
          body = &quot;{\n&quot; +
                  &quot;    \&quot;status\&quot;: \&quot;1\&quot;\n&quot; +
                  &quot;}&quot;;
      }
      request = given()
              .auth()
              .preemptive()
              .basic(System.getenv(&quot;USER_NAME&quot;), System.getenv(&quot;ZAPI_PASSWORD&quot;))
              .header(&quot;Accept&quot;, &quot;application/json&quot;)
              .header(&quot;Content-Type&quot;, &quot;application/json&quot;)
              .body(body);
      response = request.when().put(readPropertiesFile(&quot;ZEPHYR_API_URL&quot;) + &quot;/execution/&quot; + executionId + &quot;/execute&quot;);
      response.then().log().ifError().statusCode(200);
  }
  </code></pre>
  <p>Any help would be really appreciated.</p>