private void doRequestHandleTest(HttpMethod httpMethod, String uri, boolean testErrorCase, boolean useSSL)
      throws Exception {
    EmbeddedChannel channel = createChannel(useSSL);
    List<HttpHeaders> httpHeadersList = getHeadersList();
    for (HttpHeaders headers : httpHeadersList) {
      HttpRequest request = RestTestUtils.createRequest(httpMethod, uri, headers);
      HttpUtil.setKeepAlive(request, true);
      sendRequestCheckResponse(channel, request, uri, headers, testErrorCase, false, useSSL);
      if (!testErrorCase) {
        Assert.assertTrue("Channel should not be closed ", channel.isOpen());
      } else {
        Assert.assertFalse("Channel should have been closed ", channel.isOpen());
        channel = createChannel(useSSL);
      }
    }
    channel.close();
  }
Does a test to see that request handling results in expected entries in public access log
@param httpMethod the {@link HttpMethod} for the request.
@param uri Uri to be used during the request
@param testErrorCase true if error case has to be tested, false otherwise
@param useSSL {@code true} to test SSL logging.
@throws Exception
ambry-rest/src/test/java/com/github/ambry/rest/PublicAccessLogHandlerTest.java