@Test
  public void testCacheUpdatedWhenLastModifiedOfSnapDirNotUpdated() throws IOException {
    SnapshotFileCache cache = new SnapshotFileCache(fs, rootDir, workingFs, workingDir, PERIOD,
      10000000, "test-snapshot-file-cache-refresh", new SnapshotFiles());

    // Add a new non-tmp snapshot
    createAndTestSnapshotV1(cache, "snapshot1v1", false, false, true);
    createAndTestSnapshotV1(cache, "snapshot1v2", false, false, true);

    // Add a new tmp snapshot
    createAndTestSnapshotV2(cache, "snapshot2v1", true, false, true);

    // Add another tmp snapshot
    createAndTestSnapshotV2(cache, "snapshot2v2", true, false, true);
  }
Test that we correctly reload the cache, filter directories, etc.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/snapshot/TestSnapshotFileCache.java