private void sizeInHeaderLessThanContentTest() throws Exception {
    List<HttpContent> httpContents = new ArrayList<HttpContent>();
    ByteBuffer content = generateContent(httpContents);
    HttpHeaders httpHeaders = new DefaultHttpHeaders();
    int lastHttpContentSize = httpContents.get(httpContents.size() - 1).content().readableBytes();
    httpHeaders.set(HttpHeaderNames.CONTENT_LENGTH, content.limit() - lastHttpContentSize - 1);
    doHeaderAndContentSizeMismatchTest(httpHeaders, httpContents);
  }
Tests reaction of NettyRequest when content size is more than the size specified in the headers.
@throws Exception
ambry-rest/src/test/java/com/github/ambry/rest/NettyRequestTest.java