}
}
public static WicketFilter newMockFilter(final WebApplication application) {
final MockServletContext context = new MockServletContext(application, "/");
final WicketFilter filter = new WicketFilter() {
@Override
protected IWebApplicationFactory getApplicationFactory() {
return new IWebApplicationFactory() {
@Override
public WebApplication createApplication(WicketFilter filter) {
return application;
}
@Override
public void destroy(WicketFilter filter) {
// noop
};
};
}
};
try {
filter.init(new FilterConfig() {
@Override
public ServletContext getServletContext() {
return context;
}