Search in sources :

Example 1 with ConsistencyLevel

use of org.influxdb.InfluxDB.ConsistencyLevel in project jmxtrans by jmxtrans.

the class InfluxDbWriterTests method writeConsistencyLevelsAreAppliedToBatchPointsBeingWritten.

@Test
public void writeConsistencyLevelsAreAppliedToBatchPointsBeingWritten() throws Exception {
    for (ConsistencyLevel consistencyLevel : ConsistencyLevel.values()) {
        InfluxDbWriter writer = getTestInfluxDbWriterWithWriteConsistency(consistencyLevel);
        writer.doWrite(dummyServer(), dummyQuery(), results);
        verify(influxDB, atLeastOnce()).write(messageCaptor.capture());
        BatchPoints batchPoints = messageCaptor.getValue();
        assertThat(batchPoints.getConsistency()).isEqualTo(consistencyLevel);
    }
}
Also used : ConsistencyLevel(org.influxdb.InfluxDB.ConsistencyLevel) BatchPoints(org.influxdb.dto.BatchPoints) Test(org.junit.Test)

Aggregations

ConsistencyLevel (org.influxdb.InfluxDB.ConsistencyLevel)1 BatchPoints (org.influxdb.dto.BatchPoints)1 Test (org.junit.Test)1