public void testValidChecksumTypeReadBlock(byte checksumTypeCode, Corrupter c,
    HFileBlockChannelPosition testBlock) throws IOException {
    c.restore();
    c.write(HFileBlock.Header.CHECKSUM_TYPE_INDEX,
      ByteBuffer.wrap(new byte[] { checksumTypeCode }));
    logHeader(testBlock);
    try (
      HFileBlockChannelPositionIterator it = new HFileBlockChannelPositionIterator(hFileTestRule)) {
      CountingConsumer consumer = new CountingConsumer(it);
      try {
        consumer.readFully();
      } catch (Exception e) {
        fail("test fail: valid checksumType are not executing properly");
      }
      assertNotEquals(0, consumer.getItemsRead());
    }
  }
This test provides coverage for HFileHeader block fields that are read and interpreted before
HBase checksum validation can be applied. As of now, this is just
{@code onDiskSizeWithoutHeader}.
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFileBlockHeaderCorruption.java