@Test
public void testHdfsFileStatus() throws Exception {

  HdfsFileStatus hdfsFileStatus = new HdfsFileStatus.Builder()
      .replication(1)
      .blocksize(1024)
      .perm(new FsPermission((short) 777))
      .owner("owner")
      .group("group")
      .symlink(new byte[0])
      .path(new byte[0])
      .fileId(1010)
      .isdir(true)
      .build();
  assertFalse(hdfsFileStatus.isSymlink());
  LambdaTestUtils.intercept(IOException.class,
      "Path " + hdfsFileStatus.getPath() + " is not a symbolic link",
      () -> hdfsFileStatus.getSymlink());
  String expectString = new StringBuilder()
      .append("HdfsLocatedFileStatus")
      .append("{")
      .append("path=" + null)
      .append("; isDirectory=" + true)
      .append("; modification_time=" + 0)
      .append("; access_time=" + 0)
      .append("; owner=" + "owner")
      .append("; group=" + "group")
      .append("; permission=" + "r----x--t")
      .append("; isSymlink=" + false)
      .append("; hasAcl=" + false)
      .append("; isEncrypted=" + false)
      .append("; isErasureCoded=" + false)
      .append("}")
      .toString();
  assertEquals(expectString, hdfsFileStatus.toString());
}