@Test
public void shouldEscapeMeasurement() {

    Map<String, String> tags = new HashMap<String, String>();
    Map<String, Object> fields = new HashMap<String, Object>();
    fields.put("field1 Key", "field1Value");
    InfluxDbWriteObject influxDbWriteObject = new InfluxDbWriteObject("test-db", TimeUnit.MICROSECONDS);
    influxDbWriteObject.getPoints().add(new InfluxDbPoint("my measurement,1=1", tags, 456l, fields));
    InfluxDbWriteObjectSerializer influxDbWriteObjectSerializer = new InfluxDbWriteObjectSerializer("");
    String lineString = influxDbWriteObjectSerializer.getLineProtocolString(influxDbWriteObject);
    assertThat(lineString)
        .isEqualTo("my\\ measurement\\,1=1 field1\\ Key=\"field1Value\" 456000\n");
}