private TestBlobData getRandomBlob(ClusterMap referenceClusterMap) {
    BlobId blobId = getNewBlobId(referenceClusterMap);
    int size = TestUtils.RANDOM.nextInt(MAX_DATA_SIZE_IN_BYTES);
    byte[] data = new byte[size];
    TestUtils.RANDOM.nextBytes(data);
    ByteBuf blob = ByteBufAllocator.DEFAULT.heapBuffer(size);
    blob.writeBytes(data);
    size = TestUtils.RANDOM.nextInt(MAX_DATA_SIZE_IN_BYTES);
    byte[] userMetadata = new byte[size];
    TestUtils.RANDOM.nextBytes(userMetadata);
    return new TestBlobData(blobId, ByteBuffer.wrap(userMetadata), blob);
  }
Generate and return random test data (i.e. BlobId, blob content and user-metadata)
@param referenceClusterMap clusterMap from which partition info to be fetched
@return {@link TestBlobData} which contains all data for the test blob
ambry-router/src/test/java/com/github/ambry/router/CryptoJobHandlerTest.java