use of org.apache.sling.testing.mock.osgi.MockEventAdmin in project sling by apache.
the class ResourceResolverFactoryInitializer method ensureResourceResolverFactoryActivatorDependencies.
/**
* Ensure dependencies for ResourceResolverFactoryActivator are present.
* @param bundleContext Bundle context
*/
private static void ensureResourceResolverFactoryActivatorDependencies(BundleContext bundleContext) {
Dictionary<String, Object> config = new Hashtable<String, Object>();
config.put("user.mapping", bundleContext.getBundle().getSymbolicName() + "=admin");
registerServiceIfNotPresent(bundleContext, ServiceUserMapper.class, new ServiceUserMapperImpl(), config);
registerServiceIfNotPresent(bundleContext, ResourceAccessSecurityTracker.class, new ResourceAccessSecurityTracker());
registerServiceIfNotPresent(bundleContext, EventAdmin.class, new MockEventAdmin());
}
Aggregations