DFSClient dfsclient = new DFSClient(new InetSocketAddress("localhost",
cluster.getNameNodePort()), conf);
List<LocatedBlock> locatedBlocks = dfsclient.getNamenode().getBlockLocations(
FILE_TO_READ, 0, FILE_SIZE).getLocatedBlocks();
LocatedBlock lblock = locatedBlocks.get(0); // first block
BlockAccessToken myToken = lblock.getAccessToken();
// verify token is not expired
assertFalse(SecurityTestUtil.isAccessTokenExpired(myToken));
// read with valid token, should succeed
tryRead(conf, lblock, true);