use of org.asynchttpclient.cookie.CookieStore in project async-http-client by AsyncHttpClient.
the class CookieStoreTest method handleMissingPathAsRequestPathWhenPathIsNotEmpty.
private void handleMissingPathAsRequestPathWhenPathIsNotEmpty() {
CookieStore store = new ThreadSafeCookieStore();
store.add(Uri.create("http://www.foo.com/bar"), ClientCookieDecoder.LAX.decode("ALPHA=VALUE1; Domain=www.foo.com; path=/bar"));
assertTrue(store.get(Uri.create("http://www.foo.com/baz")).isEmpty());
}
use of org.asynchttpclient.cookie.CookieStore in project async-http-client by AsyncHttpClient.
the class CookieStoreTest method handleCookieNameInCaseInsensitiveManner.
// RFC 2965 sec. 3.3.3
private void handleCookieNameInCaseInsensitiveManner() {
CookieStore store = new ThreadSafeCookieStore();
Uri uri = Uri.create("http://www.foo.com/bar/baz");
store.add(uri, ClientCookieDecoder.LAX.decode("ALPHA=VALUE1; Domain=www.foo.com; path=/bar"));
store.add(uri, ClientCookieDecoder.LAX.decode("alpha=VALUE2; Domain=www.foo.com; path=/bar"));
assertTrue(store.getAll().size() == 1);
assertTrue(store.get(uri).get(0).value().equals("VALUE2"));
}
use of org.asynchttpclient.cookie.CookieStore in project async-http-client by AsyncHttpClient.
the class CookieStoreTest method handleMissingPathAsSlash.
private void handleMissingPathAsSlash() {
CookieStore store = new ThreadSafeCookieStore();
Uri uri = Uri.create("http://www.foo.com");
store.add(uri, ClientCookieDecoder.LAX.decode("tooe_token=0b1d81dd02d207491a6e9b0a2af9470da9eb1dad"));
assertTrue(store.get(uri).size() == 1);
}
use of org.asynchttpclient.cookie.CookieStore in project async-http-client by AsyncHttpClient.
the class CookieStoreTest method expireCookieWhenSetWithDateInThePast.
private void expireCookieWhenSetWithDateInThePast() {
CookieStore store = new ThreadSafeCookieStore();
Uri uri = Uri.create("http://www.foo.com/bar");
store.add(uri, ClientCookieDecoder.LAX.decode("ALPHA=VALUE1; Domain=www.foo.com; path=/bar"));
store.add(uri, ClientCookieDecoder.LAX.decode("ALPHA=EXPIRED; Domain=www.foo.com; Path=/bar; Expires=Sun, 06 Nov 1994 08:49:37 GMT"));
assertTrue(store.getAll().isEmpty());
}
use of org.asynchttpclient.cookie.CookieStore in project async-http-client by AsyncHttpClient.
the class CookieStoreTest method handleMissingPathAsRequestPathWhenFromRootDir.
private void handleMissingPathAsRequestPathWhenFromRootDir() {
CookieStore store = new ThreadSafeCookieStore();
Uri uri = Uri.create("http://www.foo.com");
store.add(uri, ClientCookieDecoder.LAX.decode("ALPHA=VALUE1"));
assertTrue(store.get(uri).size() == 1);
}
Aggregations