DDMStorageAdapterTrackerImpl implements DDMStorageAdapterTracker { @Activate protected void activate(BundleContext bundleContext) { ddmStorageAdapterServiceTrackerMap = ServiceTrackerMapFactory.openSingleValueMap( bundleContext, DDMStorageAdapter.class, "ddm.storage.adapter.type"); }  @Override DDMStorageAdapter getDDMStorageAdapter(String type); @Override Set<String> getDDMStorageAdapterTypes();  }
@Test public void testActivate() { DDMStorageAdapterTrackerImpl ddmStorageAdapterTrackerImpl = new DDMStorageAdapterTrackerImpl(); BundleContext bundleContext = mock(BundleContext.class); when( ServiceTrackerMapFactory.openSingleValueMap( bundleContext, DDMStorageAdapter.class, "ddm.storage.adapter.type") ).thenReturn( _ddmStorageAdapterServiceTrackerMap ); ddmStorageAdapterTrackerImpl.activate(bundleContext); Assert.assertNotNull( ddmStorageAdapterTrackerImpl.ddmStorageAdapterServiceTrackerMap); }