VertxDispatcher extends DispatcherBase implements Dispatcher<String> { @Override public Dispatcher<String> noAuth() { this.requireAuth = false; return this; }  void init(); @Override synchronized void close(); @Override boolean isOpen(); @Override Dispatcher<String> preHandle(Predicate<RequestContext> handler); @Override Dispatcher<String> postHandle(Consumer<RequestContext> handler); @Override Dispatcher<String> get(String s, Consumer<RequestContext> handler); @Override Dispatcher<String> head(String s, Consumer<RequestContext> handler); @Override Dispatcher<String> delete(String s, Consumer<RequestContext> handler); @Override Dispatcher<String> post(String s, Class<? extends Payload> payloadType, BiConsumer<Payload, RequestContext> handler); @Override Dispatcher<String> postJson(String s, BiConsumer<JsonObject, RequestContext> handler); @Override Dispatcher<String> post(String s, Consumer<RequestContext> handler); @Override Dispatcher<String> post(String s, BiConsumer<byte[], RequestContext> handler); @Override Dispatcher<String> postUpload(String s, Consumer<RequestContext> handler); @Override Dispatcher<String> put(String s, Consumer<RequestContext> handler); @Override Dispatcher<String> put(String s, Class<? extends Payload> payloadType, BiConsumer<Payload, RequestContext> handler); @Override Dispatcher<String> putJson(String s, BiConsumer<JsonObject, RequestContext> handler); @Override Dispatcher<String> put(String s, BiConsumer<byte[], RequestContext> handler); @Override Dispatcher<String> blocking(); @Override Dispatcher<String> noAuth(); @Override Dispatcher<String> requireAuth(); @Override Dispatcher<String> allowNotConfirmed(); @Override Dispatcher<String> filter(Predicate<RequestContext> filter, String message); @Override Dispatcher<String> filter(Predicate<RequestContext> filter, String message, Object... params); @Override Dispatcher<String> mimeTypes(String... mimeTypes); @Override Dispatcher<String> exceptionHandler(BiConsumer<Throwable, RequestContext> handler); Vertx getVertx(); void setVertx(Vertx vertx); BodyHandler getBodyHandler(); void setBodyHandler(BodyHandler bodyHandler);  }
@Test public void testNoAuth() throws Exception { final int[] count = { 0 }; dispatcher.requireAuth().get("/get/me", c -> { count[0] += 1; }); HttpClient client = vertx.createHttpClient(); httpGet(client, "/get/me", jo -> jo.getLong("error") == ErrorMessages.NOT_AUTHORISED); Assert.assertEquals(count[0], 0); }