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

    HttpRequest request = RestTestUtils.createRequest(httpMethod, uri, headers1);
    HttpUtil.setKeepAlive(request, true);
    channel.writeInbound(request);

    // contains one logged and not logged header
    HttpHeaders headers2 = new DefaultHttpHeaders();
    headers2.add(NOT_LOGGED_HEADER_KEY + "1", "headerValue1");
    headers2.add(HttpHeaderNames.CONTENT_LENGTH, new Random().nextLong());
    // sending another request w/o sending last http content
    request = RestTestUtils.createRequest(httpMethod, uri, headers2);
    HttpUtil.setKeepAlive(request, true);
    sendRequestCheckResponse(channel, request, uri, headers2, false, false, useSSL);
    Assert.assertTrue("Channel should not be closed ", channel.isOpen());

    // verify that headers from first request is not found in public access log
    String lastLogEntry = publicAccessLogger.getLastPublicAccessLogEntry();
    // verify request headers
    verifyPublicAccessLogEntryForRequestHeaders(lastLogEntry, headers1, request.method(), false);

    channel.close();
  }
Does a test to see that two consecutive requests without sending last http content for first request fails
@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