private void assertServiceMatches(RpcServerInterface rpcServer) {
    HBasePolicyProvider provider = new HBasePolicyProvider();
    Set<Class<?>> serviceClasses =
      Stream.of(provider.getServices()).map(Service::getProtocol).collect(Collectors.toSet());
    for (BlockingServiceAndInterface bsai : ((RpcServer) rpcServer).getServices()) {
      assertNotNull(
        "no security info for " + bsai.getBlockingService().getDescriptorForType().getName(),
        SecurityInfo.getInfo(bsai.getBlockingService().getDescriptorForType().getName()));
      assertThat(serviceClasses, hasItem(bsai.getServiceInterface()));
    }
  }
Make sure that all rpc services for master and region server are properly configured in
{@link SecurityInfo} and {@link HBasePolicyProvider}.
hbase-server/src/test/java/org/apache/hadoop/hbase/security/TestSecurityInfoAndHBasePolicyProviderMatch.java