HDFSFileObject extends AbstractFileObject { @Override protected boolean doSetLastModifiedTime( long modtime ) throws Exception { hdfs.setTimes( hdfs.getPath( getName().getPath() ), modtime, System.currentTimeMillis() ); return true; } HDFSFileObject( final AbstractFileName name, final HDFSFileSystem fileSystem ); @Override void doCreateFolder(); @Override void doDelete();  }
@Test public void testDoSetLastModifiedTime() throws Exception { long modtime = 48933L; long start = System.currentTimeMillis(); assertTrue( hdfsFileObject.doSetLastModifiedTime( modtime ) ); ArgumentCaptor<Long> longArgumentCaptor = ArgumentCaptor.forClass( Long.class ); verify( hadoopFileSystem ).setTimes( eq( hadoopFileSystemPath ), eq( modtime ), longArgumentCaptor.capture() ); Long accessTime = longArgumentCaptor.getValue(); assertTrue( start <= accessTime ); assertTrue( accessTime <= System.currentTimeMillis() ); }