How do you handle timeouts in REST Assured?

given()
    .config(RestAssured.config()
        .httpClient(HttpClientConfig.httpClientConfig()
            .setParam("http.connection.timeout", 5000)))
.when()
    .get("/endpoint");