use of org.apache.wicket.application.IComponentInstantiationListener in project wicket by apache.
the class DontStoreNotRenderedPageTestCase method newWicketTester.
@Override
protected WicketTester newWicketTester(WebApplication app) {
app.getComponentInstantiationListeners().add(new IComponentInstantiationListener() {
@Override
public void onInstantiation(Component component) {
// WICKET-5546 behavior added before Page#init()
component.add(new Behavior() {
});
}
});
return new WicketTester(app) {
@Override
protected IPageManagerProvider newTestPageManagerProvider() {
return new IPageManagerProvider() {
@Override
public IPageManager apply(IPageManagerContext context) {
return new MockPageManager() {
@Override
public void touchPage(IManageablePage page) {
Assert.assertFalse("PageB should not be touched!", page instanceof PageB);
super.touchPage(page);
}
};
}
};
}
};
}
Aggregations