On 29 November 2012 16:55, Eric Jablow <erjab...@gmail.com> wrote: > > 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? > > This is actually a good point to improve your application and its tests. > Use dependency injection to organize your application, say through > wicket-guice or wicket-cdi. Use an alternative test Guice module to > build your pages with while testing. So, when you reach the second > test page, it gets built with low-cost data, > It contradicts with the idea of unit tests: test only a small unit, bringing minimum dependencies. Otherwise a change in one page would break a lot of other tests. It is significant especially for web-applications, because usually pages have a lot links between them. It makes a test run longer, which would cause performance problems for large test suite.
-- WBR, Anatoly.