@Test
  public void testDeleteSnapshot() throws Exception {

    String snapshotName = "completed";
    SnapshotDescription snapshot = SnapshotDescription.newBuilder().setName(snapshotName).build();

    DeleteSnapshotRequest request =
      DeleteSnapshotRequest.newBuilder().setSnapshot(snapshot).build();
    try {
      master.getMasterRpcServices().deleteSnapshot(null, request);
      fail("Master didn't throw exception when attempting to delete snapshot that doesn't exist");
    } catch (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException e) {
      // Expected
    }

    // write one snapshot to the fs
    createSnapshot(snapshotName);

    // then delete the existing snapshot,which shouldn't cause an exception to be thrown
    master.getMasterRpcServices().deleteSnapshot(null, request);
  }
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