protected final void verifyRemovedPeer(String peerId, Path remoteWALDir, HBaseTestingUtil utility)
    throws Exception {
    ReplicationPeerStorage rps = ReplicationStorageFactory.getReplicationPeerStorage(
      utility.getTestFileSystem(), utility.getZooKeeperWatcher(), utility.getConfiguration());
    try {
      rps.getPeerSyncReplicationState(peerId);
      fail("Should throw exception when get the sync replication state of a removed peer.");
    } catch (ReplicationException e) {
      // ignore.
    }
    try {
      rps.getPeerNewSyncReplicationState(peerId);
      fail("Should throw exception when get the new sync replication state of a removed peer");
    } catch (ReplicationException e) {
      // ignore.
    }
    try (FileSystem fs = utility.getTestFileSystem()) {
      assertFalse(fs.exists(getRemoteWALDir(remoteWALDir, peerId)));
      assertFalse(fs.exists(getReplayRemoteWALs(remoteWALDir, peerId)));
    }
  }
Base class for testing sync replication.
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SyncReplicationTestBase.java