@Test
  public void testServletEchoA() throws Exception {
    URL url = new URL("http://hive@localhost:" + servletPort + "/" + path + "/" + NS);
    Map<String, String> json = Collections.singletonMap("method", "echo");
    String jwt = generateJWT();
    // succeed
    Object response = clientCall(jwt, url, "POST", json);
    Assert.assertNotNull(response);
    Assert.assertEquals(json, response);
    // fail (bad jwt)
    String badJwt = generateJWT(jwtUnauthorizedKeyFile.toPath());
    response = clientCall(badJwt, url, "POST", json);
    Assert.assertNull(response);
  }
A property client that uses http as transport.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/properties/HMSServletTest.java