IndexingWriterConfiguration implements WriterConfiguration { @Override public List<Integer> getAllConfiguredTimeouts() { return config.orElse(new IndexingConfigurations()).getAllConfiguredTimeouts(writerName); } IndexingWriterConfiguration(String writerName, IndexingConfigurations 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); @Override boolean isSetDocumentId(String sensorName);  }
@Test public void testGetAllConfiguredTimeouts() throws FileNotFoundException, IOException { IndexingWriterConfiguration config = new IndexingWriterConfiguration("hdfs", new IndexingConfigurations() ); assertEquals(0, config.getAllConfiguredTimeouts().size()); IndexingConfigurations iconfigs = new IndexingConfigurations(); iconfigs.updateSensorIndexingConfig( sensorType, new FileInputStream(sampleSensorIndexingConfigPath)); config = new IndexingWriterConfiguration("elasticsearch", iconfigs); assertEquals(1, config.getAllConfiguredTimeouts().size()); assertEquals(7, (long)config.getAllConfiguredTimeouts().get(0)); }