private void checkHttpMethods(String url) throws Exception {
    // HTTP TRACE method should be disabled for security
    // See https://www.owasp.org/index.php/Cross_Site_Tracing
    HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
    conn.setRequestMethod("TRACE");
    conn.connect();
    Assert.assertEquals(conn.getResponseMessage(), HttpURLConnection.HTTP_FORBIDDEN,
      conn.getResponseCode());
  }
Start the HBase Thrift HTTP server on a random port through the command-line interface and talk
to it from client side.
hbase-thrift/src/test/java/org/apache/hadoop/hbase/thrift/TestThriftHttpServer.java