@Test
  public void testInvalidReplicationEndpoint() throws InterruptedException {
    try {
      admin.addReplicationPeer(ID_ONE,
        ReplicationPeerConfig.newBuilder().setReplicationEndpointImpl("whatever").build()).get();
      fail();
    } catch (ExecutionException e) {
      assertThat(e.getCause(), instanceOf(DoNotRetryIOException.class));
      assertThat(e.getCause().getMessage(), startsWith("Can not instantiate"));
    }
  }
Class to test asynchronous replication admin operations.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncReplicationAdminApi.java