Description
While using WicketTester to test my WebApplication that is using a custom WebRequestCycle and WebRequestCycleProcessor I noticed that WicketTester does not follow the same RequestCycle as it would do when running in a real live environment resulting in MyWebRequestCycle.onBeginRequest not being called.
Using startPage(Page) will call MyWebRequestCycle.onBeginRequest but then the IRequestTarget that is resolved from the Request indicates the Request comes from the DummyHomePage.testPage link.
Can startPage be implemented that it really resembles the real live environment? After some research and testing I came up with this implementation, maybe it can be used:
public Page startPage(Class pageClass) {
WebRequestCycle requestCycle = super.setupRequestAndResponse();
requestCycle.getRequest().getRequestParameters().setBookmarkablePageClass(pageClass.getName());
super.processRequestCycle(requestCycle);
return super.getLastRenderedPage();
}
Attachments
Issue Links
- relates to
-
WICKET-1435 WicketTester.clickLink(String) only triggers the WebRequestCycle.onEndRequest
- Resolved