protected final void createMasterRegion() throws IOException {
    Configuration conf = htu.getConfiguration();
    configure(conf);
    choreService = new ChoreService(getClass().getSimpleName());
    hfileCleanerPool = DirScanPool.getHFileCleanerScanPool(conf);
    logCleanerPool = DirScanPool.getLogCleanerScanPool(conf);
    server = mock(Server.class);
    when(server.getConfiguration()).thenReturn(conf);
    when(server.getServerName())
      .thenReturn(ServerName.valueOf("localhost", 12345, EnvironmentEdgeManager.currentTime()));
    when(server.getChoreService()).thenReturn(choreService);
    Path testDir = htu.getDataTestDir();
    CommonFSUtils.setRootDir(conf, testDir);
    MasterRegionParams params = new MasterRegionParams();
    TableDescriptor td = TableDescriptorBuilder
      .newBuilder(TD).setValue(StoreFileTrackerFactory.TRACKER_IMPL, conf
        .get(StoreFileTrackerFactory.TRACKER_IMPL, StoreFileTrackerFactory.Trackers.DEFAULT.name()))
      .build();
    params.server(server).regionDirName(REGION_DIR_NAME).tableDescriptor(td)
      .flushSize(TableDescriptorBuilder.DEFAULT_MEMSTORE_FLUSH_SIZE).flushPerChanges(1_000_000)
      .flushIntervalMs(TimeUnit.MINUTES.toMillis(15)).compactMin(4).maxWals(32).useHsync(false)
      .ringBufferSlotCount(16).rollPeriodMs(TimeUnit.MINUTES.toMillis(15))
      .archivedWalSuffix(MasterRegionFactory.ARCHIVED_WAL_SUFFIX)
      .archivedHFileSuffix(MasterRegionFactory.ARCHIVED_HFILE_SUFFIX);
    configure(params);
    region = MasterRegion.create(params);
    postSetUp();
  }
Creates a new MasterRegion using an existing {@code htu} on this class.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/region/MasterRegionTestBase.java