[
https://issues.apache.org/jira/browse/WICKET-4104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119204#comment-13119204
]
Martin Grigorov commented on WICKET-4104:
-----------------------------------------
Here is a version of the test that passes:
wicketTester.setFollowRedirects(false); // this is important !
wicketTester.startPage(RedirectingPage.class);
assertTrue("Redirect expected",
wicketTester.getLastResponse().isRedirect());
String redirectLocation =
wicketTester.getLastResponse().getRedirectLocation();
assertTrue("Expected redirect location", !(redirectLocation.isEmpty()));
assertEquals(DESTINATION_EXPECTED, redirectLocation);
WicketTester is for simulating the browser interactions without the need to
start a web server. So it cannot work with non-pages like "http://google.com".
I.e. it should not try to follow the redirect (#setFollowRedirects(false)).
> WicketTester does not handle RedirectToUrlException
> ---------------------------------------------------
>
> Key: WICKET-4104
> URL: https://issues.apache.org/jira/browse/WICKET-4104
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.5.1
> Environment: java version "1.6.0_25"
> Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
> Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing)
> Reporter: bernard
> Assignee: Peter Ertl
> Attachments: RedirectQuickStart.zip
>
>
> The attached quickstart is only for testing of the single class, not page
> display.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira