/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the “License”). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.util;

import org.junit.Assert;
import org.junit.Test;

/**
 * Tests {@link IdUtils}.
 */
public final class IdUtilsTest {
  /**
   * Tests if output of {@link IdUtils#getRandomNonNegativeLong()} is non-negative.
   * Also tests for randomness property.
   */
  @Test
  public void getRandomNonNegativeLongTest() throws Exception {
    long first = IdUtils.getRandomNonNegativeLong();
    long second = IdUtils.getRandomNonNegativeLong();
    Assert.assertTrue(first >= 0);
    Assert.assertTrue(second >= 0);
    Assert.assertTrue(first != second);
  }
}

@@ -1076,11 +1076,707 @@
 nd);%0A  %7D
+%0A%0A  /**%0A   * Tests if output of %7B@link IdUtils#createFileId(long)%7D is valid.%0A   */%0A  @Test%0A  public void createFileIdTest() throws Exception %7B%0A    long containerId = 1;%0A    long fileId = IdUtils.createFileId(containerId);%0A    Assert.assertTrue(fileId != -1);%0A  %7D%0A%0A  /**%0A   * Tests if output of %7B@link IdUtils#createRpcId()%7D is non-empty.%0A   * Also tests for randomness property.%0A   */%0A  @Test%0A  public void createRpcIdTest() throws Exception %7B%0A    String first = IdUtils.createRpcId();%0A    Assert.assertTrue(first != null && !first.isEmpty());%0A    String second = IdUtils.createRpcId();%0A    Assert.assertTrue(second != null && !second.isEmpty());%0A    Assert.assertTrue(!first.equals(second));%0A  %7D
 %0A%7D%0A

Add unit tests for IdUtils