@Before
  public void setUp() throws IOException {
    masterStub = mock(MasterService.Interface.class);
    adminStub = mock(AdminService.Interface.class);
    doAnswer(new Answer<Void>() {

      @Override
      public Void answer(InvocationOnMock invocation) throws Throwable {
        RpcCallback<GetProcedureResultResponse> done = invocation.getArgument(2);
        done.run(GetProcedureResultResponse.newBuilder()
          .setState(GetProcedureResultResponse.State.FINISHED).build());
        return null;
      }
    }).when(masterStub).getProcedureResult(any(HBaseRpcController.class),
      any(GetProcedureResultRequest.class), any());
    doAnswer(new Answer<Void>() {

      @Override
      public Void answer(InvocationOnMock invocation) throws Throwable {
        RpcCallback<CreateTableResponse> done = invocation.getArgument(2);
        done.run(CreateTableResponse.newBuilder().setProcId(1L).build());
        return null;
      }
    }).when(masterStub).createTable(any(HBaseRpcController.class), any(CreateTableRequest.class),
      any());
    doAnswer(new Answer<Void>() {

      @Override
      public Void answer(InvocationOnMock invocation) throws Throwable {
        RpcCallback<ShutdownResponse> done = invocation.getArgument(2);
        done.run(ShutdownResponse.getDefaultInstance());
        return null;
      }
    }).when(masterStub).shutdown(any(HBaseRpcController.class), any(ShutdownRequest.class), any());
    doAnswer(new Answer<Void>() {

      @Override
      public Void answer(InvocationOnMock invocation) throws Throwable {
        RpcCallback<StopMasterResponse> done = invocation.getArgument(2);
        done.run(StopMasterResponse.getDefaultInstance());
        return null;
      }
    }).when(masterStub).stopMaster(any(HBaseRpcController.class), any(StopMasterRequest.class),
      any());

    doAnswer(new Answer<Void>() {

      @Override
      public Void answer(InvocationOnMock invocation) throws Throwable {
        RpcCallback<StopServerResponse> done = invocation.getArgument(2);
        done.run(StopServerResponse.getDefaultInstance());
        return null;
      }
    }).when(adminStub).stopServer(any(HBaseRpcController.class), any(StopServerRequest.class),
      any());
    User user = UserProvider.instantiate(CONF).getCurrent();
    conn = new AsyncConnectionImpl(CONF, new DoNothingConnectionRegistry(CONF, user), "test", null,
      user) {

      @Override
      CompletableFuture<MasterService.Interface> getMasterStub() {
        return CompletableFuture.completedFuture(masterStub);
      }

      @Override
      Interface getAdminStub(ServerName serverName) throws IOException {
        return adminStub;
      }
    };
  }
Confirm that we will set the priority in {@link HBaseRpcController} for several admin operations.
hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestAsyncAdminRpcPriority.java