@Test
  public void testBasePeerConfigsRemovalForReplicationPeer() throws Exception {
    LOG.info("testBasePeerConfigsForPeerMutations");
    String firstCustomPeerConfigKey = "hbase.xxx.custom_config";
    String firstCustomPeerConfigValue = "test";

    try {
      baseConfiguration.set(ReplicationPeerConfigUtil.HBASE_REPLICATION_PEER_BASE_CONFIG,
        firstCustomPeerConfigKey.concat("=").concat(firstCustomPeerConfigValue));
      startMiniClusters(2);
      addPeer("1", 0, 1);
      Admin admin = utilities[0].getAdmin();

      // Validates base configs 1 is present for both peer.
      Assert.assertEquals(firstCustomPeerConfigValue,
        admin.getReplicationPeerConfig("1").getConfiguration().get(firstCustomPeerConfigKey));

      utilities[0].getConfiguration()
        .unset(ReplicationPeerConfigUtil.HBASE_REPLICATION_PEER_BASE_CONFIG);
      utilities[0].getConfiguration().set(
        ReplicationPeerConfigUtil.HBASE_REPLICATION_PEER_BASE_CONFIG,
        firstCustomPeerConfigKey.concat("=").concat(""));

      utilities[0].shutdownMiniHBaseCluster();
      utilities[0].restartHBaseCluster(1);
      admin = utilities[0].getAdmin();

      // Configurations should be removed after restart again
      Assert.assertNull(
        admin.getReplicationPeerConfig("1").getConfiguration().get(firstCustomPeerConfigKey));
    } finally {
      shutDownMiniClusters();
      baseConfiguration.unset(ReplicationPeerConfigUtil.HBASE_REPLICATION_PEER_BASE_CONFIG);
    }
  }
Tests that base replication peer configs are applied on peer creation and the configs are
overriden if updated as part of updateReplicationPeerConfig()
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java