private void doRequestHandleWithKeepAliveTest(HttpMethod httpMethod, String uri, boolean useSSL) throws Exception {
    EmbeddedChannel channel = createChannel(useSSL);
    // contains one logged request header
    HttpHeaders headers = new DefaultHttpHeaders();
    headers.add(HttpHeaderNames.CONTENT_LENGTH, new Random().nextLong());

    HttpRequest request = RestTestUtils.createRequest(httpMethod, uri, headers);
    HttpUtil.setKeepAlive(request, true);
    sendRequestCheckResponse(channel, request, uri, headers, false, false, useSSL);
    Assert.assertTrue("Channel should not be closed ", channel.isOpen());

    // contains one logged and not logged header
    headers = new DefaultHttpHeaders();
    headers.add(NOT_LOGGED_HEADER_KEY + "1", "headerValue1");
    headers.add(HttpHeaderNames.CONTENT_LENGTH, new Random().nextLong());

    request = RestTestUtils.createRequest(httpMethod, uri, headers);
    HttpUtil.setKeepAlive(request, true);
    sendRequestCheckResponse(channel, request, uri, headers, false, false, useSSL);
    Assert.assertTrue("Channel should not be closed ", channel.isOpen());
    channel.close();
  }
Does a test to see that two consecutive request handling results in expected entries in public access log
with keep alive
@param httpMethod the {@link HttpMethod} for the request.
@param uri Uri to be used during the request
@param useSSL {@code true} to test SSL logging.
@throws Exception
ambry-rest/src/test/java/com/github/ambry/rest/PublicAccessLogHandlerTest.java