@Test
  public void basicTest() throws Exception {
    DiskTokenPersistor diskTokenPersistor = new DiskTokenPersistor(REPLICA_TOKEN_FILENAME, mountPathToPartitionInfoList,
        new ReplicationMetrics(new MetricRegistry(), Collections.emptyList()), clusterMap, findTokenHelper,
        mockStoreManager);

    //Simple persist and retrieve should pass
    List<RemoteReplicaInfo.ReplicaTokenInfo> replicaTokenInfoList =
        mountPathToReplicaTokenInfos.get(replicaId.getMountPath());
    diskTokenPersistor.persist(replicaId.getMountPath(), replicaTokenInfoList);
    List<RemoteReplicaInfo.ReplicaTokenInfo> retrievedReplicaTokenInfos =
        diskTokenPersistor.retrieve(replicaId.getMountPath());

    assertEquals("Number of tokens doesn't match.", replicaTokenInfoList.size(), retrievedReplicaTokenInfos.size());
    for (int i = 0; i < replicaTokenInfoList.size(); i++) {
      assertArrayEquals("Token is not correct.", replicaTokenInfoList.get(i).getReplicaToken().toBytes(),
          retrievedReplicaTokenInfos.get(i).getReplicaToken().toBytes());
    }
  }
Basic test to persist and retrieve disk tokens.
@throws Exception if an Exception happens.
ambry-replication/src/test/java/com/github/ambry/replication/DiskTokenPersistorTest.java