ServicesHelper { public List<String> getRunningServiceIds() { List<ServiceReference<Domain>> serviceReferences = osgiUtilsService.listServiceReferences(Domain.class); List<String> result = new ArrayList<String>(); for (ServiceReference<Domain> ref : serviceReferences) { result.add((String) ref.getProperty(org.osgi.framework.Constants.SERVICE_PID)); } return result; } ServicesHelper(); void init(); void listRunningServices(); List<DomainProvider> getDomainProvider(); List<String> getDomainProviderNames(); void deleteService(String id, boolean force); List<String> getRunningServiceIds(); void createService(String domainProviderName, boolean force, Map<String, String> attributes); void setOsgiUtilsService(DefaultOsgiUtilsService osgiUtilsService); BundleContext getBundleContext(); void setBundleContext(BundleContext bundleContext);  }
@Test public void testGetRunningServiceIds_shouldReturnTheRunningServiceIds() throws Exception { List<String> runningServiceIds = serviceHelper.getRunningServiceIds(); assertTrue(runningServiceIds.contains("dummyId")); }