@Test
public void shouldNotThrowException() throws Exception {

    HttpServer server = HttpServer.create(new InetSocketAddress(10081), 0);
    try {
        server.createContext("/write", new MyHandler());
        server.setExecutor(null); // creates a default executor
        server.start();
        InfluxDbHttpSender influxDbHttpSender = new InfluxDbHttpSender(
            "http",
            "localhost",
            10081,
            "testdb",
            "asdf",
            TimeUnit.MINUTES,
            1000,
            1000,
            ""
        );
        assertThat(influxDbHttpSender.writeData(new byte[0]) == 0);
    } catch (IOException e) {
        throw new IOException(e);
    } finally {
        server.stop(0);
    }
}