private HttpPost createPost(String jwt, String msgBody) {
    HttpPost method = new HttpPost("http://hive@localhost:" + servletPort + "/" + path + "/" + NS);
    method.addHeader("Authorization", "Bearer " + jwt);
    method.addHeader("Content-Type", "application/json");
    method.addHeader("Accept", "application/json");

    StringEntity sre = new StringEntity(msgBody, ContentType.APPLICATION_JSON);
    method.setEntity(sre);
    return method;
  }
Create a PostMethod populated with the expected attributes.
@param jwt the security token
@param msgBody the actual (json) payload
@return the method to be executed by a Http client
@throws Exception
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/properties/HMSServletTest.java