/** * Enable this route. * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.web.Route enable() { delegate.enable(); return this; }
@Override public InternalEndpointRoute enable() { route.enable(); return this; }
/** * Enable this route. * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.web.Route enable() { delegate.enable(); return this; }
@Override public Route enable() { return delegate.enable(); }
@Test public void testDisableEnable() throws Exception { String path = "/blah"; Route route1 = router.route(path).handler(rc -> { rc.response().setChunked(true); rc.response().write("apples"); rc.next(); }); Route route2 = router.route(path).handler(rc -> { rc.response().write("oranges"); rc.next(); }); Route route3 = router.route(path).handler(rc -> { rc.response().write("bananas"); rc.response().end(); }); testRequest(HttpMethod.GET, path, 200, "OK", "applesorangesbananas"); route2.disable(); testRequest(HttpMethod.GET, path, 200, "OK", "applesbananas"); route1.disable(); route3.disable(); testRequest(HttpMethod.GET, path, 404, "Not Found"); route3.enable(); route1.enable(); testRequest(HttpMethod.GET, path, 200, "OK", "applesbananas"); route2.enable(); testRequest(HttpMethod.GET, path, 200, "OK", "applesorangesbananas"); }
@Test public void testDisableEnable() throws Exception { String path = "/blah"; Route route1 = router.route(path).handler(rc -> { rc.response().setChunked(true); rc.response().write("apples"); rc.next(); }); Route route2 = router.route(path).handler(rc -> { rc.response().write("oranges"); rc.next(); }); Route route3 = router.route(path).handler(rc -> { rc.response().write("bananas"); rc.response().end(); }); testRequest(HttpMethod.GET, path, 200, "OK", "applesorangesbananas"); route2.disable(); testRequest(HttpMethod.GET, path, 200, "OK", "applesbananas"); route1.disable(); route3.disable(); testRequest(HttpMethod.GET, path, 404, "Not Found"); route3.enable(); route1.enable(); testRequest(HttpMethod.GET, path, 200, "OK", "applesbananas"); route2.enable(); testRequest(HttpMethod.GET, path, 200, "OK", "applesorangesbananas"); }