Description
Currently, BaseWicketTester (line 524) does this:
public <C extends Page> Result isPageLink(String path, Class<C> expectedPageClass)
{
PageLink<?> pageLink = (PageLink<?>)getComponentFromLastRenderedPage(path);
try
The problem manifests when you want to customize a page link's onClick by overriding it like this:
new PageLink<AuthPage>("pageLink", AuthPage.class) {
private static final long serialVersionUID = 1L;
@Override
public void onClick()
});
As a result; the BaseWicketTester tries to look for the pageLink field in the anonymous class instead of the privately declared pageLink field in the PageLink class.
BaseWicketTester should either go down the tree:
for(Class type = pageLink.getClass(); type != Object.class; type = type.getSuperclass())
Or a getter should be made for the pageLink field. (This is what Java wants you to do).