SensorEnrichmentConfigServiceImpl implements SensorEnrichmentConfigService { @Override public Map<String, SensorEnrichmentConfig> getAll() throws RestException { Map<String, SensorEnrichmentConfig> sensorEnrichmentConfigs = new HashMap<>(); List<String> sensorNames = getAllTypes(); for (String name : sensorNames) { SensorEnrichmentConfig config = findOne(name); if(config != null) { sensorEnrichmentConfigs.put(name, config); } } return sensorEnrichmentConfigs; } @Autowired  SensorEnrichmentConfigServiceImpl(final ObjectMapper objectMapper,
        final CuratorFramework client, final ConfigurationsCache cache,
        final HBaseClient hBaseClient); @Override SensorEnrichmentConfig save(String name, SensorEnrichmentConfig sensorEnrichmentConfig); @Override SensorEnrichmentConfig findOne(String name); @Override Map<String, SensorEnrichmentConfig> getAll(); @Override List<String> getAllTypes(); @Override boolean delete(String name); @Override List<String> getAvailableEnrichments(); @Override List<String> getAvailableThreatTriageAggregators();  }
@Test public void getAllShouldProperlyReturnSensorEnrichmentConfigs() throws Exception { final SensorEnrichmentConfig sensorEnrichmentConfig = getTestSensorEnrichmentConfig(); EnrichmentConfigurations configs = new EnrichmentConfigurations(){ @Override public Map<String, Object> getConfigurations() { return ImmutableMap.of(EnrichmentConfigurations.getKey("bro"), sensorEnrichmentConfig); } }; when(cache.get( eq(EnrichmentConfigurations.class))) .thenReturn(configs); assertEquals(Collections.singletonMap("bro", sensorEnrichmentConfig), sensorEnrichmentConfigService.getAll()); }