@Test(expected = BeanValidationException.class) public void testStoreCookie_Validation() { storage.storeCookie(null, null); }
protected void storeCookie(@NotNull CookieName name, @NotNull String value) { RequestCycle requestCycle = RequestCycle.get(); if (requestCycle == null) { LOG.warn("RequestCycle is null - cannot read cookies"); return; } WebResponse response = (WebResponse) requestCycle.getResponse(); Cookie cookie = new Cookie(name.name(), value); cookie.setMaxAge(appConfig.cookie.expirySeconds); response.addCookie(cookie); }
CookieStorage { protected void storeCookie(@NotNull CookieName name, @NotNull String value) { RequestCycle requestCycle = RequestCycle.get(); if (requestCycle == null) { LOG.warn("RequestCycle is null - cannot read cookies"); return; } WebResponse response = (WebResponse) requestCycle.getResponse(); Cookie cookie = new Cookie(name.name(), value); cookie.setMaxAge(appConfig.cookie.expirySeconds); response.addCookie(cookie); } }
CookieStorage { protected void storeCookie(@NotNull CookieName name, @NotNull String value) { RequestCycle requestCycle = RequestCycle.get(); if (requestCycle == null) { LOG.warn("RequestCycle is null - cannot read cookies"); return; } WebResponse response = (WebResponse) requestCycle.getResponse(); Cookie cookie = new Cookie(name.name(), value); cookie.setMaxAge(appConfig.cookie.expirySeconds); response.addCookie(cookie); }  }
CookieStorage { protected void storeCookie(@NotNull CookieName name, @NotNull String value) { RequestCycle requestCycle = RequestCycle.get(); if (requestCycle == null) { LOG.warn("RequestCycle is null - cannot read cookies"); return; } WebResponse response = (WebResponse) requestCycle.getResponse(); Cookie cookie = new Cookie(name.name(), value); cookie.setMaxAge(appConfig.cookie.expirySeconds); response.addCookie(cookie); }  void storeCookieAsJson(@NotNull CookieName cookieName, @NotNull Object obj); @Valid Optional<T> readCookieAsJson(@NotNull CookieName cookieName, @NotNull Class<T> clazz); }
CookieStorage { protected void storeCookie(@NotNull CookieName name, @NotNull String value) { RequestCycle requestCycle = RequestCycle.get(); if (requestCycle == null) { LOG.warn("RequestCycle is null - cannot read cookies"); return; } WebResponse response = (WebResponse) requestCycle.getResponse(); Cookie cookie = new Cookie(name.name(), value); cookie.setMaxAge(appConfig.cookie.expirySeconds); response.addCookie(cookie); }  void storeCookieAsJson(@NotNull CookieName cookieName, @NotNull Object obj); @Valid Optional<T> readCookieAsJson(@NotNull CookieName cookieName, @NotNull Class<T> clazz);  }