@BeforeClass
  public static void before() throws Exception {
    HTU.startMiniCluster(NB_SERVERS);
    final TableName tableName = TableName.valueOf(TestRegionServerNoMaster.class.getSimpleName());

    // Create table then get the single region for our new table.
    table = HTU.createTable(tableName, HConstants.CATALOG_FAMILY);
    Put p = new Put(row);
    p.addColumn(HConstants.CATALOG_FAMILY, row, row);
    table.put(p);

    try (RegionLocator locator = HTU.getConnection().getRegionLocator(tableName)) {
      hri = locator.getRegionLocation(row, false).getRegion();
    }
    regionName = hri.getRegionName();

    stopMasterAndCacheMetaLocation(HTU);
  }
Tests on the region server, without the master.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionServerNoMaster.java