public static void expectSnapshotDoneException(HMaster master, IsSnapshotDoneRequest snapshot,
    Class<? extends HBaseSnapshotException> clazz) {
    try {
      master.getMasterRpcServices().isSnapshotDone(null, snapshot);
      Assert.fail("didn't fail to lookup a snapshot");
    } catch (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException se) {
      try {
        throw ProtobufUtil.handleRemoteException(se);
      } catch (HBaseSnapshotException e) {
        assertEquals("Threw wrong snapshot exception!", clazz, e.getClass());
      } catch (Throwable t) {
        Assert.fail("Threw an unexpected exception:" + t);
      }
    }
  }
Expect the snapshot to throw an error when checking if the snapshot is complete
@param master   master to check
@param snapshot the {@link SnapshotDescription} request to pass to the master
@param clazz    expected exception from the master
hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java