@Test(timeout = 5000L)
public void testUnknownApplicationAttemptId() throws Exception {

  YarnClient mockYarnClient = createMockYarnClientUnknownApp();
  LogsCLI cli = new LogsCLIForTest(mockYarnClient);
  cli.setConf(conf);
  ApplicationId appId = ApplicationId.newInstance(0, 1);
  int exitCode = cli.run(new String[] {"-applicationAttemptId",
          ApplicationAttemptId.newInstance(appId, 1).toString() });
  // Error since no logs present for the app.
  assertTrue(exitCode != 0);
  assertTrue(sysErrStream.toString().contains(
          "Unable to get ApplicationState."));
}