@Test
  public void deletionTimeEnforcementTest() throws Exception {
    // no change before delete time
    Pair<Long, List<LogSegmentName>> deleteTimeAndSegmentsUnderCompaction = setupStateWithDeletedBlobsAtSpecificTime();
    long deleteReferenceTimeMs = deleteTimeAndSegmentsUnderCompaction.getFirst() - Time.MsPerSec;
    Map<LogSegmentName, Long> oldSegmentNamesAndEndOffsets =
        getEndOffsets(deleteTimeAndSegmentsUnderCompaction.getSecond());
    compactAndVerify(deleteTimeAndSegmentsUnderCompaction.getSecond(), deleteReferenceTimeMs, false);
    verifyNoChangeInEndOffsets(oldSegmentNamesAndEndOffsets);

    // no change at delete time.
    deleteTimeAndSegmentsUnderCompaction = setupStateWithDeletedBlobsAtSpecificTime();
    deleteReferenceTimeMs = deleteTimeAndSegmentsUnderCompaction.getFirst();
    oldSegmentNamesAndEndOffsets = getEndOffsets(deleteTimeAndSegmentsUnderCompaction.getSecond());
    compactAndVerify(deleteTimeAndSegmentsUnderCompaction.getSecond(), deleteReferenceTimeMs, false);
    verifyNoChangeInEndOffsets(oldSegmentNamesAndEndOffsets);

    // there will be changes past delete time
    deleteTimeAndSegmentsUnderCompaction = setupStateWithDeletedBlobsAtSpecificTime();
    state.advanceTime(Time.MsPerSec);
    compactAndVerify(deleteTimeAndSegmentsUnderCompaction.getSecond(), state.time.milliseconds(), true);
  }
Tests the case where deletion time is enforced i.e. data is considered valid before reference time and is copied
over and data is considered invalid after reference time and is not copied over.
@throws Exception
ambry-store/src/test/java/com/github/ambry/store/BlobStoreCompactorTest.java