@Test
  public void testSnapshotCleanupStatus() throws Exception {
    // Enable auto snapshot cleanup for the cluster
    SetSnapshotCleanupRequest setSnapshotCleanupRequest =
      SetSnapshotCleanupRequest.newBuilder().setEnabled(true).build();
    master.getMasterRpcServices().switchSnapshotCleanup(null, setSnapshotCleanupRequest);

    // Check if auto snapshot cleanup is enabled
    IsSnapshotCleanupEnabledRequest isSnapshotCleanupEnabledRequest =
      IsSnapshotCleanupEnabledRequest.newBuilder().build();
    IsSnapshotCleanupEnabledResponse isSnapshotCleanupEnabledResponse =
      master.getMasterRpcServices().isSnapshotCleanupEnabled(null, isSnapshotCleanupEnabledRequest);
    Assert.assertTrue(isSnapshotCleanupEnabledResponse.getEnabled());

    // Disable auto snapshot cleanup for the cluster
    setSnapshotCleanupRequest = SetSnapshotCleanupRequest.newBuilder().setEnabled(false).build();
    master.getMasterRpcServices().switchSnapshotCleanup(null, setSnapshotCleanupRequest);

    // Check if auto snapshot cleanup is disabled
    isSnapshotCleanupEnabledRequest = IsSnapshotCleanupEnabledRequest.newBuilder().build();
    isSnapshotCleanupEnabledResponse =
      master.getMasterRpcServices().isSnapshotCleanupEnabled(null, isSnapshotCleanupEnabledRequest);
    Assert.assertFalse(isSnapshotCleanupEnabledResponse.getEnabled());
  }
Test that the contract from the master for checking on a snapshot are valid.
<p>
<ol>
<li>If a snapshot fails with an error, we expect to get the source error.</li>
<li>If there is no snapshot name supplied, we should get an error.</li>
<li>If asking about a snapshot has hasn't occurred, you should get an error.</li>
</ol>
hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestSnapshotFromMaster.java