private static void getBlobAndVerify(BlobId blobId, ConnectedChannel channel, ServerErrorCode expectedErrorCode,
      BlobProperties expectedProperties, byte[] expectedUserMetadata, byte[] expectedData, byte[] expectedEncryptionKey,
      MockClusterMap clusterMap, BlobIdFactory blobIdFactory, boolean testEncryption, GetOption getOption)
      throws Exception {
    ArrayList<BlobId> listIds = new ArrayList<>();
    listIds.add(blobId);
    ArrayList<PartitionRequestInfo> partitionRequestInfoList = new ArrayList<>();
    PartitionRequestInfo partitionRequestInfo = new PartitionRequestInfo(blobId.getPartition(), listIds);
    partitionRequestInfoList.add(partitionRequestInfo);

    // get blob all
    GetRequest getRequest = new GetRequest(1, "clientid2", MessageFormatFlags.All, partitionRequestInfoList, getOption);
    DataInputStream stream = channel.sendAndReceive(getRequest).getInputStream();
    GetResponse response = GetResponse.readFrom(stream, clusterMap);

    Assert.assertEquals(ServerErrorCode.NoError, response.getError());
    Assert.assertEquals(expectedErrorCode, response.getPartitionResponseInfoList().get(0).getErrorCode());
    if (expectedErrorCode != ServerErrorCode.NoError) {
      releaseNettyBufUnderneathStream(stream);
      return;
    }

    InputStream responseStream = response.getInputStream();
    BlobAll blobAll = MessageFormatRecord.deserializeBlobAll(responseStream, blobIdFactory);

    // verify the BlobProperties
    BlobProperties propertyOutput = blobAll.getBlobInfo().getBlobProperties();
    assertTrue(expectedProperties.contentEquals(propertyOutput));

    // verify the user metadata
    byte[] userMetadataOutput = blobAll.getBlobInfo().getUserMetadata();
    assertArrayEquals(expectedUserMetadata, userMetadataOutput);

    // verify the content
    byte[] actualBlobData = getBlobData(blobAll.getBlobData());
    assertArrayEquals("Content mismatch.", expectedData, actualBlobData);
    if (testEncryption) {
      assertNotNull("EncryptionKey should not ne null", blobAll.getBlobEncryptionKey());
      assertArrayEquals("EncryptionKey mismatch", expectedEncryptionKey, blobAll.getBlobEncryptionKey().array());
    } else {
      assertNull("EncryptionKey should have been null", blobAll.getBlobEncryptionKey());
    }
    releaseNettyBufUnderneathStream(stream);
  }
get the Blob and verify the BlobProperties, userMetadata and content.
ambry-test-utils/src/main/java/com/github/ambry/server/ServerTestUtil.java