@Test
  public void testFileCleanup() throws Exception {

    Record record = new Record();
    store.setBaseFolder("/tmp/recordings");
    store.setDeleteAfter(1); // delete after 1 second
    store.setCleanupInterval(2);
    store.init();

    File f = store.createRecording(record);

    FileOutputStream fos = new FileOutputStream(f);
    fos.write("test".getBytes());
    fos.flush();
    fos.close();
    assertTrue(f.exists());

    Thread.sleep(3000);

    assertFalse(f.exists());
  }