@Test
  public void testModifyStoreFileTrackerError() throws IOException {
    TableName tableName = TableName.valueOf(name.getMethodName());
    byte[] family = Bytes.toBytes("info");
    TEST_UTIL.createTable(tableName, family).close();

    // table not exists
    assertThrows(TableNotFoundException.class,
      () -> ADMIN.modifyTableStoreFileTracker(TableName.valueOf("whatever"),
        StoreFileTrackerFactory.Trackers.FILE.name()));
    // family not exists
    assertThrows(NoSuchColumnFamilyException.class,
      () -> ADMIN.modifyColumnFamilyStoreFileTracker(tableName, Bytes.toBytes("not_exists"),
        StoreFileTrackerFactory.Trackers.FILE.name()));
    // to migration
    assertThrows(DoNotRetryIOException.class, () -> ADMIN.modifyTableStoreFileTracker(tableName,
      StoreFileTrackerFactory.Trackers.MIGRATION.name()));
    // disabled
    ADMIN.disableTable(tableName);
    assertThrows(TableNotEnabledException.class, () -> ADMIN.modifyTableStoreFileTracker(tableName,
      StoreFileTrackerFactory.Trackers.FILE.name()));
  }
Verify schema change for read only table
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin3.java