IndexingConfigurations extends Configurations { public boolean isSetDocumentId(String sensorName, String writerName) { return isSetDocumentId(getGlobalConfig(true), getSensorIndexingConfig(sensorName, writerName)); }  Map<String, Object> getSensorIndexingConfig(String sensorType, boolean emptyMapOnNonExistent); Map<String, Object> getSensorIndexingConfig(String sensorType); List<String> getTypes(); void delete(String sensorType); Map<String, Object> getSensorIndexingConfig(String sensorType, String writerName); void updateSensorIndexingConfig(String sensorType, byte[] data); void updateSensorIndexingConfig(String sensorType, InputStream io); void updateSensorIndexingConfig(String sensorType, Map<String, Object> sensorIndexingConfig); static String getKey(String sensorType); boolean isDefault(String sensorName, String writerName); int getBatchSize(String sensorName, String writerName ); int getBatchTimeout(String sensorName, String writerName ); List<Integer> getAllConfiguredTimeouts(String writerName); String getIndex(String sensorName, String writerName); boolean isEnabled(String sensorName, String writerName); String getOutputPathFunction(String sensorName, String writerName); String getFieldNameConverter(String sensorName, String writerName); boolean isSetDocumentId(String sensorName, String writerName); static boolean isEnabled(Map<String, Object> conf); static int getBatchSize(Map<String, Object> conf); static int getBatchTimeout(Map<String, Object> conf); static String getIndex(Map<String, Object> conf, String sensorName); static String getOutputPathFunction(Map<String, Object> conf, String sensorName); static String getFieldNameConverter(Map<String, Object> conf, String sensorName); static boolean isSetDocumentId(Map<String, Object> globalConf, Map<String, Object> sensorConf); static Map<String, Object> setEnabled(Map<String, Object> conf, boolean enabled); static Map<String, Object> setBatchSize(Map<String, Object> conf, int batchSize); static Map<String, Object> setBatchTimeout(Map<String, Object> conf, int batchTimeout); static Map<String, Object> setIndex(Map<String, Object> conf, String index); static Map<String, Object> setFieldNameConverter(Map<String, Object> conf, String index); static final String BATCH_SIZE_CONF; static final String BATCH_TIMEOUT_CONF; static final String ENABLED_CONF; static final String INDEX_CONF; static final String OUTPUT_PATH_FUNCTION_CONF; static final String FIELD_NAME_CONVERTER_CONF; static final String SET_DOCUMENT_ID_CONF; static final String GLOBAL_ELASTICSEARCH_SET_DOCUMENT_ID_CONF; }
@Test public void shouldReturnDefaultSetDocumentId() throws Exception { assertFalse(configurations.isSetDocumentId("sensor", "writer")); }
@Test public void shouldReturnGlobalSetDocumentId() throws Exception { configurations.updateGlobalConfig(globalConfig.getBytes(StandardCharsets.UTF_8)); assertTrue(configurations.isSetDocumentId("sensor", "writer")); assertTrue(configurations.isSetDocumentId("anySensor", "writer")); }