示例#1
0
文件: Timeout.java 项目: 4z3/yoke
  @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();
          }
        });
  }