GoogleHadoopFileSystemBase extends FileSystem implements FileSystemDescriptor { @Override public void initialize(URI path, Configuration config) throws IOException { initialize(path, config, true); } GoogleHadoopFileSystemBase();   GoogleHadoopFileSystemBase(GoogleCloudStorageFileSystem gcsFs); abstract Path getHadoopPath(URI gcsPath); abstract URI getGcsPath(Path hadoopPath); abstract Path getDefaultWorkingDirectory(); @Override abstract Path getFileSystemRoot(); @Override abstract String getScheme(); @Override Path makeQualified(final Path path); @Override void initialize(URI path, Configuration config); void initialize(URI path, Configuration config, boolean initSuperclass); @Override URI getUri(); @Override FSDataInputStream open(Path hadoopPath, int bufferSize); @Override FSDataOutputStream create(
      Path hadoopPath,
      FsPermission permission,
      boolean overwrite,
      int bufferSize,
      short replication,
      long blockSize,
      Progressable progress); @Override FSDataOutputStream createNonRecursive(
      Path hadoopPath,
      FsPermission permission,
      EnumSet<org.apache.hadoop.fs.CreateFlag> flags,
      int bufferSize,
      short replication,
      long blockSize,
      Progressable progress); @Override FSDataOutputStream append(Path hadoopPath, int bufferSize, Progressable progress); @Override void concat(Path tgt, Path[] srcs); @Override boolean rename(Path src, Path dst); @Override boolean delete(Path hadoopPath, boolean recursive); @Override FileStatus[] listStatus(Path hadoopPath); @Override void setWorkingDirectory(Path hadoopPath); @Override Path getWorkingDirectory(); @Override boolean mkdirs(Path hadoopPath, FsPermission permission); @Override short getDefaultReplication(); @Override FileStatus getFileStatus(Path hadoopPath); @Override FileStatus[] globStatus(Path pathPattern); @Override FileStatus[] globStatus(Path pathPattern, PathFilter filter); @Override Path getHomeDirectory(); @Override String getCanonicalServiceName(); GoogleCloudStorageFileSystem getGcsFs(); @Override boolean deleteOnExit(Path f); @Override ContentSummary getContentSummary(Path f); @Override Token<?> getDelegationToken(String renewer); @Override void copyFromLocalFile(boolean delSrc, boolean overwrite, Path[] srcs, Path dst); @Override void copyFromLocalFile(boolean delSrc, boolean overwrite, Path src, Path dst); @Override void copyToLocalFile(boolean delSrc, Path src, Path dst); @Override Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile); @Override void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile); @Override void close(); @Override long getUsed(); @Override long getDefaultBlockSize(); @Override FileChecksum getFileChecksum(Path hadoopPath); @Override void setVerifyChecksum(boolean verifyChecksum); @Override void setPermission(Path p, FsPermission permission); @Override void setOwner(Path p, String username, String groupname); @Override void setTimes(Path p, long mtime, long atime); @Override byte[] getXAttr(Path path, String name); @Override Map<String, byte[]> getXAttrs(Path path); @Override Map<String, byte[]> getXAttrs(Path path, List<String> names); @Override List<String> listXAttrs(Path path); @Override void setXAttr(Path path, String name, byte[] value, EnumSet<XAttrSetFlag> flags); @Override void removeXAttr(Path path, String name); static final short REPLICATION_FACTOR_DEFAULT; static final PathFilter DEFAULT_FILTER; static final String PROPERTIES_FILE; static final String VERSION_PROPERTY; static final String UNKNOWN_VERSION; static final String VERSION; static final String GHFS_ID; }
@Test public void testInvalidCredentialFromAccessTokenProvider() throws Exception { Configuration config = new Configuration(); config.set("fs.gs.auth.access.token.provider.impl", TestingAccessTokenProvider.class.getName()); URI gsUri = new URI("gs: GoogleHadoopFileSystem ghfs = new GoogleHadoopFileSystem(); ghfs.initialize(gsUri, config); IOException thrown = assertThrows(IOException.class, () -> ghfs.exists(new Path("gs: assertThat(thrown).hasCauseThat().hasMessageThat().contains("Invalid Credentials"); }