@Test
  public void doFileCopyMetaDataResponseTest() throws IOException{
    short requestVersionToUse = 1;
    LogInfo logInfo1 = new StoreLogInfo(new StoreFileInfo("0_log", 1000L),
        new ArrayList<>(Collections.singletonList(new StoreFileInfo("0_1_index", 1010L))),
        new ArrayList<>(Collections.singletonList(new StoreFileInfo("0_1_bloom", 1020L))));

    LogInfo logInfo2 = new StoreLogInfo(new StoreFileInfo("1_log", 1050L),
        new ArrayList<>(Collections.singletonList(new StoreFileInfo("1_1_index", 1030L))),
        new ArrayList<>(Collections.singletonList(new StoreFileInfo("1_1_bloom", 1040L))));
    List<LogInfo> logInfoList = new ArrayList<>(Arrays.asList(logInfo1, logInfo2));

    FileCopyGetMetaDataResponse response = new FileCopyGetMetaDataResponse(requestVersionToUse, 111, "id1", 2,
        logInfoList, "snapshotId", ServerErrorCode.NoError, null);

    DataInputStream requestStream1 = serAndPrepForRead(response, -1, false);
    FileCopyGetMetaDataResponse response1 = FileCopyGetMetaDataResponse.readFrom(requestStream1);

    Assert.assertEquals(111, response1.getCorrelationId());
    Assert.assertEquals(1, response1.versionId);
    Assert.assertEquals(ServerErrorCode.NoError, response1.getError());
    Assert.assertEquals(2, response1.getNumberOfLogfiles());
    Assert.assertEquals(2, response1.getLogInfos().size());
    Assert.assertEquals("snapshotId", response1.getSnapshotId());

    Assert.assertEquals("0_log", response1.getLogInfos().get(0).getLogSegment().getFileName());
    Assert.assertEquals(1000, (long)response1.getLogInfos().get(0).getLogSegment().getFileSize());
    Assert.assertEquals(1, response1.getLogInfos().get(0).getIndexSegments().size());
    Assert.assertEquals(1, response1.getLogInfos().get(0).getBloomFilters().size());

    Assert.assertEquals("1_log", response1.getLogInfos().get(1).getLogSegment().getFileName());
    Assert.assertEquals(1050, (long)response1.getLogInfos().get(1).getLogSegment().getFileSize());
    Assert.assertEquals(1, response1.getLogInfos().get(1).getIndexSegments().size());
    Assert.assertEquals(1, response1.getLogInfos().get(1).getBloomFilters().size());

    Assert.assertEquals("0_1_index", response1.getLogInfos().get(0).getIndexSegments().get(0).getFileName());
    Assert.assertEquals(1010, (long)response1.getLogInfos().get(0).getIndexSegments().get(0).getFileSize());

    Assert.assertEquals("0_1_bloom", response1.getLogInfos().get(0).getBloomFilters().get(0).getFileName());
    Assert.assertEquals(1020, (long)response1.getLogInfos().get(0).getBloomFilters().get(0).getFileSize());

    Assert.assertEquals("1_1_index", response1.getLogInfos().get(1).getIndexSegments().get(0).getFileName());
    Assert.assertEquals(1030, (long)response1.getLogInfos().get(1).getIndexSegments().get(0).getFileSize());

    Assert.assertEquals("1_1_bloom", response1.getLogInfos().get(1).getBloomFilters().get(0).getFileName());
    Assert.assertEquals(1040, (long)response1.getLogInfos().get(1).getBloomFilters().get(0).getFileSize());
    response.release();

    response = new FileCopyGetMetaDataResponse(requestVersionToUse, 111, "id1", 2,
        logInfoList, "snapshotId", ServerErrorCode.IOError, null);
    DataInputStream requestStream2 = serAndPrepForRead(response, -1, false);
    FileCopyGetMetaDataResponse response2 = FileCopyGetMetaDataResponse.readFrom(requestStream2);
    Assert.assertEquals(ServerErrorCode.IOError, response2.getError());
    response.release();
  }
Test the {@link StoreFileChunk#from} method.
@throws IOException
ambry-protocol/src/test/java/com/github/ambry/protocol/RequestResponseTest.java