@Test
  public void testHMConnectorServerWhenShutdownCluster() throws Exception {
    boolean accessDenied = false;
    try {
      LOG.info("Stopping HMaster...");
      admin.shutdown();
    } catch (AccessDeniedException e) {
      LOG.error("Exception occurred while stopping HMaster. ", e);
      accessDenied = true;
    }
    Assert.assertTrue(accessDenied);

    checkConnector();
  }
This tests to validate the HMaster's ConnectorServer after unauthorised shutdown call.
hbase-server/src/test/java/org/apache/hadoop/hbase/TestJMXConnectorServer.java