ParserWriterConfiguration implements WriterConfiguration { @Override public String getIndex(String sensorName) { if(config != null && config.getSensorParserConfig(sensorName) != null && config.getSensorParserConfig(sensorName).getParserConfig() != null ) { Object indexObj = config.getSensorParserConfig(sensorName).getParserConfig().get(IndexingConfigurations.INDEX_CONF); if(indexObj != null) { return indexObj.toString(); } return null; } return sensorName; } ParserWriterConfiguration(ParserConfigurations config); @Override int getBatchSize(String sensorName); @Override int getBatchTimeout(String sensorName); @Override List<Integer> getAllConfiguredTimeouts(); @Override String getIndex(String sensorName); @Override boolean isEnabled(String sensorName); @Override Map<String, Object> getSensorConfig(String sensorName); @Override Map<String, Object> getGlobalConfig(); @Override boolean isDefault(String sensorName); @Override String getFieldNameConverter(String sensorName);  }
@Test public void testDefaultIndex() { ParserWriterConfiguration config = new ParserWriterConfiguration( new ParserConfigurations() ); assertEquals("foo", config.getIndex("foo")); }