@Test
  public void doFileCopyMetaDataRequestTest() throws IOException {
    short requestVersionToUse = 1;
    FileCopyGetMetaDataRequest request =
        new FileCopyGetMetaDataRequest(requestVersionToUse, 111, "id1",
            new MockPartitionId(), "host3");
    DataInputStream requestStream = serAndPrepForRead(request, -1, true);
    FileCopyGetMetaDataRequest fileMetadataRequestFromBytes =
        FileCopyGetMetaDataRequest.readFrom(requestStream, new MockClusterMap());
    Assert.assertEquals("host3", fileMetadataRequestFromBytes.getHostName());
    Assert.assertEquals(0l, fileMetadataRequestFromBytes.getPartitionId().getId());
    Assert.assertEquals("0", fileMetadataRequestFromBytes.getPartitionId().toPathString());
    request.release();

    try {
      // Sending null partition id. Expected to throw exception.
      new FileCopyGetMetaDataRequest(requestVersionToUse, 111, "id1",
          null, "host3");
      Assert.fail("Should have thrown exception");
    } catch (NullPointerException e) {
      //expected
    }
    try {
      // Sending empty host name. Expected to throw exception.
      new FileCopyGetMetaDataRequest(requestVersionToUse, 111, "id1",
          new MockPartitionId(), "");
      Assert.fail("Should have thrown exception");
    } catch (IllegalArgumentException e) {
      //expected
    }
  }
Test for undelete request and response.
@throws IOException
ambry-protocol/src/test/java/com/github/ambry/protocol/RequestResponseTest.java