Details
Description
I have a sample application here: https://github.com/bartgeluykens/Whiskey
Tests fails because BaseWicketTest.lastRenderedPage is empty.
The reason is that in the RenderPageRequestHandler we execute the following statement Application.get().getPageRendererProvider().get(this) which depends on an other BaseWicketTest instance than the current one. Afterwards the lastRenderedPage gets filled on the wrong class instance.
I temporary solved it by adding the following statements in the processRequest procedure underneath the if "if (!requestCycle.processRequestAndDetach())" block:
if (Application.get().getPageRendererProvider() instanceof LastPageRecordingPageRendererProvider)
{ LastPageRecordingPageRendererProvider lastPageRecordingPageRendererProvider = (LastPageRecordingPageRendererProvider) Application.get().getPageRendererProvider(); lastRenderedPage = lastPageRecordingPageRendererProvider.getLastPage(); }Probably the best solution is to make the lastRenderedPage variable static, but I did not test this.