SensorIndexingConfigServiceImpl implements SensorIndexingConfigService { @Override public List<String> getAllTypes() throws RestException { IndexingConfigurations configs = cache.get( IndexingConfigurations.class); return configs.getTypes(); } @Autowired  SensorIndexingConfigServiceImpl(ObjectMapper objectMapper, CuratorFramework client, ConfigurationsCache cache); @Override Map<String, Object> save(String name, Map<String, Object> sensorIndexingConfig); @Override Map<String, Object> findOne(String name); @Override Map<String, Map<String, Object>> getAll(); @Override List<String> getAllTypes(); @Override Iterable<String> getAllIndices(String writerName); @Override boolean delete(String name);  }
@Test public void getAllTypesShouldProperlyReturnTypes() throws Exception { IndexingConfigurations configs = new IndexingConfigurations(){ @Override public Map<String, Object> getConfigurations() { return ImmutableMap.of(IndexingConfigurations.getKey("bro"), new HashMap<>() ,IndexingConfigurations.getKey("squid"), new HashMap<>() ); } }; when(cache.get(eq(IndexingConfigurations.class))) .thenReturn(configs); assertEquals(new ArrayList() {{ add("bro"); add("squid"); }}, sensorIndexingConfigService.getAllTypes()); }