Example #1
0
  @Test
  public void testTimeout() {
    YokeTester yoke = new YokeTester(vertx);
    yoke.use(new com.jetdrone.vertx.yoke.middleware.Timeout(10));
    yoke.use(
        new Handler<YokeRequest>() {
          @Override
          public void handle(YokeRequest request) {
            // noop to so the response would never end
          }
        });

    yoke.request(
        "GET",
        "/",
        new Handler<Response>() {
          @Override
          public void handle(Response resp) {
            assertEquals(408, resp.getStatusCode());
            testComplete();
          }
        });
  }