VfsCache extends ForwardingFileSystem { @Override public void setattr(Inode inode, Stat stat) throws IOException { _inner.setattr(inode, stat); invalidateStatCache(inode); } VfsCache(VirtualFileSystem inner, VfsCacheConfig cacheConfig); @Override void commit(Inode inode, long offset, int count); @Override Inode symlink(Inode parent, String path, String link, Subject subject, int mode); @Override void remove(Inode parent, String path); @Override Inode parentOf(Inode inode); @Override boolean move(Inode src, String oldName, Inode dest, String newName); @Override Inode mkdir(Inode parent, String path, Subject subject, int mode); @Override Inode link(Inode parent, Inode link, String path, Subject subject); @Override Inode lookup(Inode parent, String path); @Override FsStat getFsStat(); @Override Inode create(Inode parent, Stat.Type type, String path, Subject subject, int mode); @Override Stat getattr(Inode inode); @Override void setattr(Inode inode, Stat stat); @Override boolean getCaseInsensitive(); @Override boolean getCasePreserving(); void invalidateLookupCache(Inode parent, String path); void invalidateStatCache(final Inode inode); @Override DirectoryStream list(Inode inode, byte[] verifier, long cookie); @Override void removeXattr(Inode inode, String attr); @Override void setXattr(Inode inode, String attr, byte[] value, SetXattrMode mode);  }
@Test public void shouldWriteThrough() throws IOException { Stat s = new Stat(); vfsCache.setattr(root, s); verify(vfs).setattr(root, s); }