@Test
 public void testRequiredArgs() throws Exception {
   NoHandleApplicationOptionHandler handler = new NoHandleApplicationOptionHandler();
   YarnClusterInfoCommand command = new YarnClusterInfoCommand(handler);
   command.run("-a", "aaa", "-c", "ccc");
   assertThat(handler.output, is("output"));
 }
 @Test
 public void testDefaultOptionHelp() {
   YarnClusterInfoCommand command = new YarnClusterInfoCommand();
   assertThat(command.getHelp(), containsString("-a, --application-id"));
   assertThat(command.getHelp(), containsString("-c, --cluster-id"));
   assertThat(command.getHelp(), containsString("-v, --verbose"));
 }
 @Test
 public void testCustomOptionHandlerFailure() throws Exception {
   thrown.expect(IllegalArgumentException.class);
   thrown.expectMessage(is("no jee"));
   CustomClusterInfoOptionHandler handler = new CustomClusterInfoOptionHandler();
   YarnClusterInfoCommand command = new YarnClusterInfoCommand(handler);
   command.run("-a", "foo");
 }
 @Test
 public void testFailureNoArgs() throws Exception {
   thrown.expect(IllegalStateException.class);
   thrown.expectMessage(containsString("Cluster Id and Application Id must be defined"));
   NoRunClusterInfoOptionHandler handler = new NoRunClusterInfoOptionHandler();
   YarnClusterInfoCommand command = new YarnClusterInfoCommand(handler);
   command.run(new String[0]);
 }
 @Test
 public void testShouldNotFail() throws Exception {
   NoRunClusterInfoOptionHandler handler = new NoRunClusterInfoOptionHandler();
   YarnClusterInfoCommand command = new YarnClusterInfoCommand(handler);
   command.run("-a", "xxx", "-c", "xxx", "-v");
 }