@Test
  public void testBackupHistory() throws Exception {
    int n = 10;
    List<BackupInfo> list = createBackupInfoList(n);

    // Load data
    for (BackupInfo bc : list) {
      // Make sure we set right status
      bc.setState(BackupState.COMPLETE);
      table.updateBackupInfo(bc);
    }

    // Reverse list for comparison
    Collections.reverse(list);
    List<BackupInfo> history = table.getBackupHistory();
    assertTrue(history.size() == n);

    for (int i = 0; i < n; i++) {
      BackupInfo ctx = list.get(i);
      BackupInfo data = history.get(i);
      assertTrue(compare(ctx, data));
    }

    cleanBackupTable();

  }
Test cases for backup system table API
hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupSystemTable.java