@Test
public void testDFSWithInvalidCommmand() throws Throwable {

  FsShell shell = new FsShell(new Configuration());
  try (GenericTestUtils.SystemErrCapturer capture =
           new GenericTestUtils.SystemErrCapturer()) {
    ToolRunner.run(shell, new String[]{"dfs -mkdirs"});
    Assert.assertThat("FSShell dfs command did not print the error " +
            "message when invalid command is passed",
        capture.getOutput(), StringContains.containsString(
            "-mkdirs: Unknown command"));
    Assert.assertThat("FSShell dfs command did not print help " +
            "message when invalid command is passed",
        capture.getOutput(), StringContains.containsString(
            "Usage: hadoop fs [generic options]"));
  }
}