@Test
public void hdfsShouldStart() throws Exception {

    Assertions.assertThat(Utils.available("127.0.0.1", 20112)).isFalse();
    // Write a file to HDFS containing the test string
    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();
    // Read the file and compare to test string
    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://localhost:%s/webhdfs/v1?op=GETHOMEDIRECTORY&user.name=guest",
                    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);
}