SensorEnrichmentConfigServiceImpl implements SensorEnrichmentConfigService { @Override public List<String> getAllTypes() throws RestException { EnrichmentConfigurations configs = cache.get( EnrichmentConfigurations.class); return configs.getTypes(); } @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 getAllTypesShouldProperlyReturnTypes() throws Exception { EnrichmentConfigurations configs = new EnrichmentConfigurations(){ @Override public Map<String, Object> getConfigurations() { return ImmutableMap.of(EnrichmentConfigurations.getKey("bro"), new HashMap<>() ,EnrichmentConfigurations.getKey("squid"), new HashMap<>() ); } }; when(cache.get(eq(EnrichmentConfigurations.class))) .thenReturn(configs); assertEquals(new ArrayList<String>() {{ add("bro"); add("squid"); }}, sensorEnrichmentConfigService.getAllTypes()); }