DataSourceManager implements Managed { @Override public void start() { Map<DataSource, DataRepository> sources = new HashMap<>(); for (DataSource source : dataSourceRepository.getAll()) { sources.put(source, createDataRepository(source)); } processorChainManager.startAllProcessorChains(sources); } @Inject  DataSourceManager(
			DataSourceRepository dataSourceRepository,
			Cache<DataRepository> dataRepositoryCache,
			DbConnectorFactory dbConnectorFactory,
			RepositoryFactory repositoryFactory,
			ProcessorChainManager processorChainManager,
			DataViewManager dataViewManager,
			NotificationManager notificationManager); void add(DataSource source); void remove(DataSource source); List<DataSource> getAll(); DataSource findBySourceId(String sourceId); DataRepository getDataRepository(DataSource source); boolean isValidSourceId(String sourceId); @Override void start(); @Override void stop();  }
@Test public void testStart() { new Expectations() {{ sourceRepository.getAll(); result = Arrays.asList(dataSource); repositoryFactory.createSourceDataRepository(SOURCE_ID, (JsonPointer) any); result = dataRepository; }}; sourceManager.start(); new Verifications() {{ Map<DataSource, DataRepository> sources; processorChainManager.startAllProcessorChains(sources = withCapture()); Assert.assertTrue(sources.containsKey(dataSource)); }}; }