WicketTester Cookie handling
----------------------------
Key: WICKET-1886
URL: https://issues.apache.org/jira/browse/WICKET-1886
Project: Wicket
Issue Type: Bug
Affects Versions: 1.3.4
Reporter: Jörn Zaefferer
Fix For: 1.3.6
Attachments: CookieTest.java
While trying to test my SecureForm implementation
(https://issues.apache.org/jira/browse/WICKET-1885) with WicketTester I ran
into this issue: A cookie set in the response never shows up in the "next"
request, because both have their own lists of cookies that aren't shared.
Afaik both should share the same List instance to handle cookies. That way its
possible to set a cookie in the response and read it from the request.
A simple testcase:
{code:title=CookieTest.java|borderStyle=solid}
import javax.servlet.http.Cookie;
import org.apache.wicket.util.tester.WicketTester;
import junit.framework.TestCase;
public class CookieTest extends TestCase {
public void testWicketTesterCookies() {
WicketTester tester = new WicketTester();
tester.getWicketResponse().addCookie(new Cookie("foo", "bar"));
assertEquals("bar",
tester.getWicketRequest().getCookie("foo").getValue());
}
}
{code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.