@Test
  public void testCloneSnapshotFailsDueToTTLExpired() throws Exception {
    String snapshotName = "expiredTTLCloneSnapshotTest";

    // table should exist
    assertTrue(UTIL.getAdmin().tableExists(TABLE_NAME));

    // create snapshot fo given table with specified ttl
    createSnapshotWithTTL(TABLE_NAME, snapshotName, 1);
    Admin admin = UTIL.getAdmin();

    assertTrue(UTIL.getAdmin().tableExists(TABLE_NAME));

    // Sleep so that TTL may expire
    Threads.sleep(2000);

    // clone snapshot which has expired
    try {
      admin.cloneSnapshot(snapshotName, CLONED_TABLE_NAME);
      fail("Clone snapshot succeeded even though TTL has expired.");
    } catch (SnapshotTTLExpiredException e) {
      LOG.info("Correctly failed to clone a TTL expired snapshot table:" + e.getMessage());
    }

    // table should not be created
    assertFalse(UTIL.getAdmin().tableExists(CLONED_TABLE_NAME));
  }
Setup the config for the cluster
@throws Exception on failure
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestSnapshotWithTTLFromClient.java