@Test
  public void testLogCleaning() throws Exception {
    LOG.info(currentTest.getMethodName());
    Configuration localConf = new Configuration(conf);
    localConf.set(WALFactory.WAL_PROVIDER, FSHLogProvider.class.getName());
    WALFactory wals = new WALFactory(localConf, currentTest.getMethodName());
    try {
      testLogCleaning(wals);
    } finally {
      wals.close();
    }
  }
helper method to simulate region flush for a WAL.
hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestFSHLogProvider.java