SensorEnrichmentConfigServiceImpl implements SensorEnrichmentConfigService { @Override public SensorEnrichmentConfig findOne(String name) throws RestException { EnrichmentConfigurations configs = cache.get( EnrichmentConfigurations.class); return configs.getSensorEnrichmentConfig(name); } @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 findOneShouldProperlyReturnSensorEnrichmentConfig() 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(getTestSensorEnrichmentConfig(), sensorEnrichmentConfigService.findOne("bro")); assertNull(sensorEnrichmentConfigService.findOne("blah")); }