@Test public void testCookie() throws Exception { System.out.println(Thread.currentThread().getName() + " " + vertx.getOrCreateContext() + " " + Vertx.currentContext()); String c = "mediaWiki.user.id=0kn3VaEP7XG7mbxRPNgBOe5DNfOAGaHL; centralnotice_bucket=0-4.2; " + "uls-previous-languages=%5B%22en%22%5D; mediaWiki.user.sessionId=Mu2OplNdlL98mRoHEwKGlxYsOXbyP1f0; GeoIP=::::v6"; HttpRequest req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/"); req.headers().set(HeaderNames.COOKIE, c); ContextFromVertx context = new ContextFromVertx(vertx, vertx.getOrCreateContext(), accessor, RequestFromVertXTest.create(req)); assertThat(context.cookies().get("mediaWiki.user.id").value()).isEqualTo("0kn3VaEP7XG7mbxRPNgBOe5DNfOAGaHL"); assertThat(context.cookies().get("GeoIP").value()).isEqualTo("::::v6"); assertThat(context.cookie("mediaWiki.user.id").value()).isEqualTo("0kn3VaEP7XG7mbxRPNgBOe5DNfOAGaHL"); assertThat(context.hasCookie("GeoIP")).isTrue(); assertThat(context.cookie("GeoIP").value()).isEqualTo("::::v6"); assertThat(context.cookieValue("GeoIP")).isEqualTo("::::v6"); req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/"); context = new ContextFromVertx(vertx, vertx.getOrCreateContext(), accessor, RequestFromVertXTest.create(req)); assertThat(context.cookies().get("GeoIP")).isNull(); assertThat(context.cookie("GeoIP")).isNull(); assertThat(context.hasCookie("GeoIP")).isFalse(); }
@Override public Cookie cookie(String cookieName) { return request().cookie(cookieName); }
ContextFromVertx implements Context { @Override public Cookie cookie(String cookieName) { return request().cookie(cookieName); } }
ContextFromVertx implements Context { @Override public Cookie cookie(String cookieName) { return request().cookie(cookieName); } ContextFromVertx(Vertx vertx, io.vertx.core.Context vertxContext, ServiceAccessor accessor, HttpServerRequest req); }
ContextFromVertx implements Context { @Override public Cookie cookie(String cookieName) { return request().cookie(cookieName); } ContextFromVertx(Vertx vertx, io.vertx.core.Context vertxContext, ServiceAccessor accessor, HttpServerRequest req); @Override Long id(); @Override Request request(); @Override String path(); @Override FlashCookie flash(); @Override SessionCookie session(); @Override Cookie cookie(String cookieName); @Override boolean hasCookie(String cookieName); @Override Cookies cookies(); @Override String contextPath(); @Override String parameter(String name); @Override Map<String, List<String>> attributes(); @Override Map<String, List<String>> form(); @Override List<String> parameterMultipleValues(String name); @Override String parameter(String name, String defaultValue); @Override Integer parameterAsInteger(String name); @Override Integer parameterAsInteger(String name, Integer defaultValue); @Override Boolean parameterAsBoolean(String name); @Override Boolean parameterAsBoolean(String name, boolean defaultValue); @Override String parameterFromPath(String name); @Override String parameterFromPathEncoded(String name); @Override Integer parameterFromPathAsInteger(String key); @Override Map<String, List<String>> parameters(); @Override String header(String name); @Override List<String> headers(String name); @Override Map<String, List<String>> headers(); @Override String cookieValue(String name); @Override T body(Class<T> classOfT); @Override T body(Class<T> classOfT, Type genericType); String body(); @Override byte[] raw(); @Override BufferedReader reader(); @Override Route route(); void route(Route route); @Override boolean isMultipart(); @Override Collection<? extends FileItem> files(); @Override FileItem file(String name); void cleanup(); boolean ready(); Vertx vertx(); io.vertx.core.Context vertxContext(); @Override String toString(); }
ContextFromVertx implements Context { @Override public Cookie cookie(String cookieName) { return request().cookie(cookieName); } ContextFromVertx(Vertx vertx, io.vertx.core.Context vertxContext, ServiceAccessor accessor, HttpServerRequest req); @Override Long id(); @Override Request request(); @Override String path(); @Override FlashCookie flash(); @Override SessionCookie session(); @Override Cookie cookie(String cookieName); @Override boolean hasCookie(String cookieName); @Override Cookies cookies(); @Override String contextPath(); @Override String parameter(String name); @Override Map<String, List<String>> attributes(); @Override Map<String, List<String>> form(); @Override List<String> parameterMultipleValues(String name); @Override String parameter(String name, String defaultValue); @Override Integer parameterAsInteger(String name); @Override Integer parameterAsInteger(String name, Integer defaultValue); @Override Boolean parameterAsBoolean(String name); @Override Boolean parameterAsBoolean(String name, boolean defaultValue); @Override String parameterFromPath(String name); @Override String parameterFromPathEncoded(String name); @Override Integer parameterFromPathAsInteger(String key); @Override Map<String, List<String>> parameters(); @Override String header(String name); @Override List<String> headers(String name); @Override Map<String, List<String>> headers(); @Override String cookieValue(String name); @Override T body(Class<T> classOfT); @Override T body(Class<T> classOfT, Type genericType); String body(); @Override byte[] raw(); @Override BufferedReader reader(); @Override Route route(); void route(Route route); @Override boolean isMultipart(); @Override Collection<? extends FileItem> files(); @Override FileItem file(String name); void cleanup(); boolean ready(); Vertx vertx(); io.vertx.core.Context vertxContext(); @Override String toString();  }