@Test
  public void putValueTest() {
    LogSegmentName logSegmentName = StoreTestUtils.getRandomLogSegmentName(null);
    long size = Utils.getRandomLong(TestUtils.RANDOM, 1000);
    long offset = Utils.getRandomLong(TestUtils.RANDOM, 1000);
    long operationTimeAtMs = Utils.getRandomLong(TestUtils.RANDOM, 1000000) + SystemTime.getInstance().milliseconds();
    long expectedOperationTimeV1 = Utils.getTimeInMsToTheNearestSec(operationTimeAtMs);
    short accountId = Utils.getRandomShort(TestUtils.RANDOM);
    short containerId = Utils.getRandomShort(TestUtils.RANDOM);
    short lifeVersion = (short) 0;

    List<Long> testExpiresAtMs = new ArrayList<>();
    // random value
    long expirationTimeAtMs = Utils.getRandomLong(TestUtils.RANDOM, 1000000) + SystemTime.getInstance().milliseconds();
    testExpiresAtMs.add(expirationTimeAtMs);
    // no expiry
    testExpiresAtMs.add(Utils.Infinite_Time);
    // max value -1
    expirationTimeAtMs = TimeUnit.SECONDS.toMillis(Integer.MAX_VALUE - 1);
    testExpiresAtMs.add(expirationTimeAtMs);
    // max value
    expirationTimeAtMs = TimeUnit.SECONDS.toMillis(Integer.MAX_VALUE);
    testExpiresAtMs.add(expirationTimeAtMs);
    // expiry > Integer.MAX_VALUE, expected to be -1
    expirationTimeAtMs = TimeUnit.SECONDS.toMillis((long) Integer.MAX_VALUE + 1);
    testExpiresAtMs.add(expirationTimeAtMs);
    // expiry < 0. This is to test how negative expiration values are treated in deser path.
    expirationTimeAtMs = -1 * TimeUnit.DAYS.toMillis(1);
    testExpiresAtMs.add(expirationTimeAtMs);
    // expiry < 0. This is to test how negative expiration values are treated in deser path.
    expirationTimeAtMs = (long) Integer.MIN_VALUE;
    testExpiresAtMs.add(expirationTimeAtMs);

    for (long expiresAtMs : testExpiresAtMs) {
      IndexValue value =
          getIndexValue(size, new Offset(logSegmentName, offset), expiresAtMs, operationTimeAtMs, accountId,
              containerId, lifeVersion, version);
      verifyIndexValue(value, logSegmentName, size, offset, EnumSet.noneOf(IndexValue.Flags.class), expiresAtMs, offset,
          expectedOperationTimeV1, accountId, containerId, lifeVersion);
    }
  }
Tests an {@link IndexValue} that is representative of a PUT index entry value.
ambry-store/src/test/java/com/github/ambry/store/IndexValueTest.java