Assert.assertNotNull(Application.get().getResourceSettings().getResourceFinder());
}
public void testHonorsResourceFinderSettingsSetByApplication()
{
final IResourceFinder customResourceFinder = new IResourceFinder()
{
public IResourceStream find(Class<?> clazz, String pathname)
{
throw new UnsupportedOperationException("Not implemented");
}
@Override
public String toString()
{
return "customResourceFinder";
}
};
WebApplication wicketApplication = new DummyWebApplication()
{
@Override
protected void init()
{
IResourceSettings resourceSettings = getResourceSettings();
resourceSettings.setResourceFinder(customResourceFinder);
}
};
new MockWebApplication(wicketApplication, "foo");
IResourceFinder resourceFinderInApplication = Application.get().getResourceSettings().getResourceFinder();
Assert.assertSame(customResourceFinder, resourceFinderInApplication);
}