@Test
  public void versionOneReadTest() throws IOException {
    String storeName = "store";
    long referenceTimeMs = Utils.getRandomLong(TestUtils.RANDOM, Long.MAX_VALUE);
    CompactionDetails details = getCompactionDetails(referenceTimeMs);
    CompactionLog cLog = new CompactionLog(tempDirStr, storeName, CompactionLog.VERSION_1, time, details, config);
    LogSegmentName logSegmentName = details.getLogSegmentsUnderCompaction().get(0);
    Offset before = new Offset(logSegmentName, LogSegment.HEADER_SIZE);
    Offset after = new Offset(logSegmentName.getNextGenerationName(), LogSegment.HEADER_SIZE);
    cLog.addBeforeAndAfterIndexSegmentOffsetPair(before, after);
    Assert.assertFalse(cLog.isIndexSegmentOffsetsPersisted());
    Assert.assertEquals(0, cLog.getBeforeAndAfterIndexSegmentOffsets().size());
    cLog.close();
    // Adding index segment offset pair shouldn't change any of the version 1 compaction log
    cLog = new CompactionLog(tempDirStr, storeName, STORE_KEY_FACTORY, time, config);
    Assert.assertFalse(cLog.isIndexSegmentOffsetsPersisted());
    Assert.assertEquals(0, cLog.getBeforeAndAfterIndexSegmentOffsets().size());
    verifyEquality(details, cLog.getCompactionDetails());
    assertEquals("Current Idx not as expected", 0, cLog.getCurrentIdx());
  }
Tests the reading of version 1
@throws IOException
ambry-store/src/test/java/com/github/ambry/store/CompactionLogTest.java