@Test public void removesMaxAgeInFavourOfExpireIfDateIsInThePast() { String cookieValue = "hp_pos=\"\"; Domain=.dev-hotels.com; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/"; Cookie cookie = ClientCookieDecoder.LAX.decode(cookieValue); String encodedCookieValue = ServerCookieEncoder.LAX.encode(cookie); assertThat(encodedCookieValue, not(containsString("Max-Age=0"))); assertThat(encodedCookieValue, containsString("Expires=Thu, 01 Jan 1970 00:00")); }
String encode(String name, String value) { return encode(new DefaultCookie(name, value)); }
ServerCookieEncoder extends CookieEncoder { String encode(String name, String value) { return encode(new DefaultCookie(name, value)); } }
ServerCookieEncoder extends CookieEncoder { String encode(String name, String value) { return encode(new DefaultCookie(name, value)); } private  ServerCookieEncoder(boolean strict); }
ServerCookieEncoder extends CookieEncoder { String encode(String name, String value) { return encode(new DefaultCookie(name, value)); } private  ServerCookieEncoder(boolean strict);  }
ServerCookieEncoder extends CookieEncoder { String encode(String name, String value) { return encode(new DefaultCookie(name, value)); } private  ServerCookieEncoder(boolean strict);   }