}
public void test_Write_Cookie_Domain()
{
final List<Cookie> cookies = CollectionFactory.newList();
CookiesImpl cs = new CookiesImpl(new ContextPathSource()
{
public String getContextPath()
{
return "/context";
}
}, null, new CookieSink()
{
public void addCookie(Cookie cookie)
{
cookies.add(cookie);
}
}, 1000);
cs.writeDomainCookieValue("foo", "bar", "fobar.com", 1234);
Cookie expectedCookie = new ComparableCookie("foo", "bar", 1234);
expectedCookie.setPath("/context/");
expectedCookie.setDomain("fobar.com");
assertEquals(cookies.size(), 1);
assertEquals(cookies.get(0), expectedCookie);