ServicesFactoryImpl injector = new ServicesFactoryImpl();
injector.init(Collections.<Module>singletonList(new Module() {
public void configure(ServicesFactory injector) {
injector.setInstance(ResourceCodec.class, mockedCodec);
injector.setInstance(org.richfaces.cache.Cache.class, mockCache);
injector.setInstance(Uptime.class, new Uptime());
injector.setInstance(DependencyInjector.class, new DependencyInjectorImpl());
injector.setInstance(ConfigurationService.class, new ConfigurationServiceImpl());
}
}));
ServiceTracker.setFactory(injector);