@Test
  public void multipartRequestDecodeTest() throws Exception {
    String[] digestAlgorithms = {"", "MD5", "SHA-1", "SHA-256"};
    for (String digestAlgorithm : digestAlgorithms) {
      // request without content
      doMultipartDecodeTest(0, null, digestAlgorithm);

      final int BLOB_PART_SIZE = 1024;
      // number of parts including the Blob
      final int NUM_TOTAL_PARTS = 5;
      Random random = new Random();
      InMemoryFile[] files = new InMemoryFile[NUM_TOTAL_PARTS];
      for (int i = 0; i < NUM_TOTAL_PARTS; i++) {
        files[i] = new InMemoryFile("part-" + i, ByteBuffer.wrap(TestUtils.getRandomBytes(random.nextInt(128) + 128)));
      }

      // request without blob (but has other parts)
      doMultipartDecodeTest(0, files, digestAlgorithm);

      // request with blob and other parts
      files[NUM_TOTAL_PARTS - 1] = new InMemoryFile(RestUtils.MultipartPost.BLOB_PART,
          ByteBuffer.wrap(TestUtils.getRandomBytes(BLOB_PART_SIZE)));
      doMultipartDecodeTest(BLOB_PART_SIZE, files, digestAlgorithm);
    }
  }
Tests that multipart requests are decoded successfully and verifies that the decoded data matches the source data.
Request kinds tested:
1. Request without content.
2. Request without a {@link RestUtils.MultipartPost#BLOB_PART} but with other parts.
3. Request with a {@link RestUtils.MultipartPost#BLOB_PART} and with other parts.
@throws Exception
ambry-rest/src/test/java/com/github/ambry/rest/NettyMultipartRequestTest.java