- private static BundleContext mockBundleContext() {
- BundleContext bundleContext = Mockito.mock(BundleContext.class);
- ServiceRegistration<ModuleFactory> serviceRegistration = mock(ServiceRegistration.class);
- doNothing().when(serviceRegistration).unregister();
- doReturn(serviceRegistration).when(bundleContext).registerService(
- Matchers.any(String[].class), any(Closeable.class),
- any(Dictionary.class));
- return bundleContext;
- }
-