Hdfs3Bootstrap implements BootstrapHadoop3 { public FileSystem getHdfsFileSystemHandle() throws Exception { return hdfsLocalCluster.getHdfsFileSystemHandle(); } Hdfs3Bootstrap();  Hdfs3Bootstrap(URL url); @Override String getProperties(); @Override ComponentMetadata getMetadata(); @Override void loadConfig(Map<String, String> configs); @Override Bootstrap start(); @Override Bootstrap stop(); @Override org.apache.hadoop.conf.Configuration getConfiguration(); FileSystem getHdfsFileSystemHandle();  }
@Test public void hdfsShouldStart() throws Exception { Assertions.assertThat(Utils.available("127.0.0.1", 20112)).isFalse(); FileSystem hdfsFsHandle = ((Hdfs3Bootstrap) HadoopBootstrap.INSTANCE.getService("HDFS3")).getHdfsFileSystemHandle(); FSDataOutputStream writer = hdfsFsHandle.create( new Path(configuration.getString(Hdfs3Config.HDFS3_TEST_FILE_KEY))); writer.writeUTF(configuration.getString(Hdfs3Config.HDFS3_TEST_STRING_KEY)); writer.close(); FSDataInputStream reader = hdfsFsHandle.open( new Path(configuration.getString(Hdfs3Config.HDFS3_TEST_FILE_KEY))); assertEquals(reader.readUTF(), configuration.getString(Hdfs3Config.HDFS3_TEST_STRING_KEY)); reader.close(); hdfsFsHandle.close(); URL url = new URL( String.format("http: configuration.getInt(Hdfs3Config.HDFS3_NAMENODE_HTTP_PORT_KEY))); URLConnection connection = url.openConnection(); connection.setRequestProperty("Accept-Charset", "UTF-8"); BufferedReader response = new BufferedReader(new InputStreamReader(connection.getInputStream())); String line = response.readLine(); response.close(); assertThat("{\"Path\":\"/user/guest\"}").isEqualTo(line); }