Ok, but what I should call to render DummyBasePage after calling: tester.getRequestCycle().setResponsePage(DummyBasePage.class); without making a new request?
-- Daniel On Wed, Feb 5, 2014 at 12:01 PM, Martin Grigorov <mgrigo...@apache.org>wrote: > #processRequest() triggers a new request to the "server" > so first the page is rendered, then a new request to the default > destination is made, so the home page is rendered and "lastRenderedPage" > changes > > Martin Grigorov > Wicket Training and Consulting > > > On Wed, Feb 5, 2014 at 11:39 AM, Daniel Stoch <daniel.st...@gmail.com > >wrote: > > > One more question: what is a difference between these two calls: > > > > 1. > > tester.startPage(DummyBasePage.class); > > Result result = tester.isRenderedPage(DummyBasePage.class); > > > > 2. > > tester.getRequestCycle().setResponsePage(DummyBasePage.class); > > tester.processRequest(); > > Result result = tester.isRenderedPage(DummyBasePage.class); > > > > The first one works ok (DummyBasePage is rendered), but the second fails: > > HomePage is rendered instead of DummyBasePage. Why? > > > > -- > > Daniel > > > > > > > > On Wed, Feb 5, 2014 at 10:40 AM, Martin Grigorov <mgrigo...@apache.org > > >wrote: > > > > > Try with tester.setExposeExceptions(false) before making the request to > > the > > > secured page > > > > > > Martin Grigorov > > > Wicket Training and Consulting > > > > > > > > > On Wed, Feb 5, 2014 at 10:33 AM, Daniel Stoch <daniel.st...@gmail.com > > > >wrote: > > > > > > > Hi, > > > > > > > > I'm during migration from Wicket 1.4.x to 6.x and I have the > following > > > > problem with WicketTester. > > > > I have some secured page, during its initialization some kind of > > > > AuthorizationException is raised. It should end with displaying > > standard > > > > AccessDeniedPage. Here is a code fragment from test case: > > > > > > > > 1.4.x: > > > > RequestCycle.get().setResponsePage(SecuredDummyPage.class); > > > > tester.processRequestCycle(requestCycle); > > > > Result result = tester.isRenderedPage(AccessDeniedPage.class); > > > > assertFalse(result.getMessage(), result.wasFailed()); > > > > > > > > This test is passed. > > > > > > > > But in 6.13 the similar test: > > > > RequestCycle.get().setResponsePage(SecuredDummyPage.class); > > > > tester.processRequest(); > > > > // or tester.startPage(SecuredDummyPage.class) > > > > Result result = tester.isRenderedPage(AccessDeniedPage.class); > > > > assertFalse(result.getMessage(), result.wasFailed()); > > > > > > > > is not passed. It is end up on this AuthorizationException and > > > > AccessDeniedPage is not rendered. > > > > Should it be rendered or should I have to change my test, because in > > 6.x > > > it > > > > works in different way? > > > > > > > > -- > > > > Daniel > > > > > > > > > >