public void setUp() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
context = (BundleContext) Mockito.mock(BundleContext.class);
Mockito.when(context.getProperty(DependencyHandler.PROXY_TYPE_PROPERTY)).thenReturn(null);
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);