Hi Anatoly, You are doing it right. To be able to verify that the other page is the response this other page have to be properly rendered, otherwise you would receive InternalErrorPage instead. To render it Wicket uses the normal rendering process so you need all prerequisites ...
You can use tester#startComponentInPage() to test on component level. But this is not what you need. On Wed, Nov 28, 2012 at 9:56 PM, Anatoly Kupriyanov <[email protected]>wrote: > Hi all, > > I'm trying to implement a unit test for a page. The unit testing means I > should test one page only. > Suppose I have a page with a link. When I do > > wicketTester.clickLink("myLink"); > > The WicketTester renders another page, the page rendering requires a lot of > other injected dependencies, and the unit test set-up grows too much > making the test fragile. I just want to verify that another page is set as > a response page. > > Is it possible to do it? What are the best practices for unit testing of a > wicket application? > > -- > WBR, Anatoly. > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com <http://jweekend.com/>
