Search in sources :

Example 1 with MockPanelWithLink

use of org.apache.wicket.MockPanelWithLink in project wicket by apache.

the class WicketTesterTest method startPanelGoesToAnotherPage.

/**
 * https://issues.apache.org/jira/browse/WICKET-3913
 */
@Test
public void startPanelGoesToAnotherPage() {
    tester.startComponentInPage(new MockPanelWithLink("testPanel") {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onLinkClick(AjaxRequestTarget target) {
            setResponsePage(DummyHomePage.class);
        }
    });
    tester.clickLink("testPanel:link");
    tester.assertRenderedPage(DummyHomePage.class);
    tester.assertComponent("testPage", TestLink.class);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) MockPanelWithLink(org.apache.wicket.MockPanelWithLink) Test(org.junit.Test)

Aggregations

MockPanelWithLink (org.apache.wicket.MockPanelWithLink)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 Test (org.junit.Test)1