    @Test
    void flush()
            throws IOException
    {

        Buffer buffer = new Buffer(bufferConfig, recordFormatter);

        Ingester ingester = mock(Ingester.class);
        buffer.flush(ingester, false);

        verify(ingester, times(0)).ingest(anyString(), any(ByteBuffer.class));

        Map<String, Object> data = new HashMap<>();
        data.put("name", "komamitsu");
        buffer.append("foodb.bartbl", 1420070400, data);

        buffer.flush(ingester, false);

        verify(ingester, times(0)).ingest(anyString(), any(ByteBuffer.class));

        buffer.flush(ingester, true);

        verify(ingester, times(1)).ingest(eq("foodb.bartbl"), any(ByteBuffer.class));
    }