Mockito.when(context.getProperty(Logger.IPOJO_LOG_LEVEL_PROP)).thenReturn(null);
Mockito.when(context.getBundle()).thenReturn(new MockBundle(this.getClass().getClassLoader()));
factory = (ComponentFactory) Mockito.mock(ComponentFactory.class);
Mockito.when(factory.getBundleClassLoader()).thenReturn(ProvidedServiceHandler.class.getClassLoader());
logger = Mockito.spy(new Logger(context, "TEST", Logger.INFO));
Mockito.when(factory.getLogger()).thenReturn(logger);
im = (InstanceManager) Mockito.mock(InstanceManager.class);
Mockito.when(im.getContext()).thenReturn(context);
Mockito.when(im.getGlobalContext()).thenReturn(context);