*/
@Test
public void callsOnFailure()
{
WicketTester tester = new WicketTester(new DummyApplication()
{
/**
* @see org.apache.wicket.protocol.http.WebApplication#init()
*/
@Override
protected void init()
{
super.init();
getExceptionSettings().setAjaxErrorHandlingStrategy(
AjaxErrorStrategy.INVOKE_FAILURE_HANDLER);
}
});
tester.setExposeExceptions(false);
tester.startPage(InternalErrorCallsAjaxOnFailurePage.class);
tester.clickLink("failure-link", true);
MockHttpServletResponse errorPageResponse = tester.getLastResponse();
assertEquals(500, errorPageResponse.getStatus());
// assert that the original page is still the last rendered one
tester.assertRenderedPage(InternalErrorCallsAjaxOnFailurePage.class);
}