title: In REST Assured, how do I set a timeout?
body: <p>I'm using RestAssured 2.8.0 
  and I'm trying to set my own timeout (for gateway timeout),
  so if I don't get response after X milliseconds I want to abort.</p>
  
  <p>I tried:</p>
  
  <pre><code>public static ValidatableResponse postWithConnectionConfig(String url, String body, RequestSpecification requestSpecification, ResponseSpecification responseSpecification) {
      ConnectionConfig.CloseIdleConnectionConfig closeIdleConnectionConfig = new ConnectionConfig.CloseIdleConnectionConfig(1L, TimeUnit.MILLISECONDS);
      ConnectionConfig connectionConfig = new ConnectionConfig(closeIdleConnectionConfig);
      RestAssuredConfig restAssuredConfig = new RestAssuredConfig().connectionConfig(connectionConfig);
  
  
      return given().specification(requestSpecification)
              .body(body)
              .config(restAssuredConfig)
              .post(url)
              .then()
              .specification(responseSpecification);
  
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>ConnectionConfig connectionConfig = new ConnectionConfig()
              .closeIdleConnectionsAfterEachResponseAfter(10L, TimeUnit.MILLISECONDS);
  RestAssuredConfig restAssuredConfig = new RestAssuredConfig().connectionConfig(connectionConfig);
  </code></pre>
  
  <p>I also tried to add </p>
  
  <pre><code>.queryParam("SO_TIMEOUT", 10)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>.queryParam("CONNECTION_MANAGER_TIMEOUT", 10)
  </code></pre>
  
  <p>nothing seem to work.
  It doesn't abort my query</p>