@Test
  public void testBatchDeleteRequestResponse() throws IOException {
    final MockClusterMap clusterMap = new MockClusterMap();
    final short accountId = Utils.getRandomShort(TestUtils.RANDOM);
    final short containerId = Utils.getRandomShort(TestUtils.RANDOM);
    final String clientId = "client";
    final PartitionId partitionId = clusterMap.getWritablePartitionIds(MockClusterMap.DEFAULT_PARTITION_CLASS).get(0);
    final BlobId blobId1 = new BlobId(CommonTestUtils.getCurrentBlobIdVersion(), BlobId.BlobIdType.NATIVE,
        ClusterMap.UNKNOWN_DATACENTER_ID, accountId, containerId, partitionId, false, BlobId.BlobDataType.DATACHUNK);
    final BlobId blobId2 = new BlobId(CommonTestUtils.getCurrentBlobIdVersion(), BlobId.BlobIdType.NATIVE,
        ClusterMap.UNKNOWN_DATACENTER_ID, accountId, containerId, partitionId, false, BlobId.BlobDataType.DATACHUNK);
    final int correlationId = TestUtils.RANDOM.nextInt();
    final long deletionTimeInMs = 1L;

    BatchDeletePartitionRequestInfo batchDeletePartitionRequestInfo =
        new BatchDeletePartitionRequestInfo(partitionId, Arrays.asList(blobId1, blobId2));
    BatchDeleteRequest batchDeleteRequest =
        new BatchDeleteRequest(correlationId, clientId, Collections.singletonList(batchDeletePartitionRequestInfo),
            deletionTimeInMs);

    DataInputStream requestStream = serAndPrepForRead(batchDeleteRequest, -1, true);
    final BatchDeleteRequest deserializedBatchDeleteRequest = BatchDeleteRequest.readFrom(requestStream, clusterMap);
    //verify the request
    verifyBatchDeleteRequest(batchDeleteRequest, deserializedBatchDeleteRequest);
    batchDeleteRequest.release();

    final BatchDeletePartitionResponseInfo batchDeletePartitionResponseInfo =
        new BatchDeletePartitionResponseInfo(partitionId,
            Arrays.asList(new BlobDeleteStatus(blobId1, ServerErrorCode.NoError),
                new BlobDeleteStatus(blobId2, ServerErrorCode.NoError)));
    final BatchDeleteResponse batchDeleteResponse = new BatchDeleteResponse((short) 1, correlationId, clientId,
        Collections.singletonList(batchDeletePartitionResponseInfo), ServerErrorCode.NoError);
    requestStream = serAndPrepForRead(batchDeleteResponse, -1, false);
    final BatchDeleteResponse deserializedBatchDeleteResponse = BatchDeleteResponse.readFrom(requestStream, clusterMap);
    //verify the response
    verifyBatchDeleteResponse(batchDeleteResponse, deserializedBatchDeleteResponse);
    batchDeleteResponse.release();
  }
Tests for {@link BatchDeleteRequest} and {@link BatchDeleteResponse}.
@throws IOException
ambry-protocol/src/test/java/com/github/ambry/protocol/RequestResponseTest.java