SensorEnrichmentConfigServiceImpl implements SensorEnrichmentConfigService { @Override public List<String> getAvailableEnrichments() throws RestException { try { List<String> enrichments = hBaseClient.readRecords(); enrichments.sort(Comparator.naturalOrder()); return enrichments; } catch (IOException e) { throw new RestException("Unable to retrieve enrichments", e); } } @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 getAvailableEnrichmentsShouldReturnEnrichmentsSorted() throws Exception { when(hBaseClient.readRecords()).thenReturn(new ArrayList<String>() {{ add("geo"); add("whois"); add("host"); add("a-new-one"); }}); assertEquals(new ArrayList<String>() {{ add("a-new-one"); add("geo"); add("host"); add("whois"); }}, sensorEnrichmentConfigService.getAvailableEnrichments()); }