Help implements BaseCommand { @Override public String execute(CommandContext commandContext, String[] args) { if (args != null && args.length > 0) { return commandHelp(args[0]); } else { return mainHelp(); } }  @Override String execute(CommandContext commandContext, String[] args);  }
@Test public void testGreeting() throws Exception { Help help = new Help(); String output = help.execute(Mockito.mock(CommandContext.class), new String[]{"greeting"}); assertThat(output, containsString("COMMAND NAME")); assertThat(output, containsString("greeting")); assertThat(output, containsString("EXAMPLE")); assertThat(output, containsString("greeting dubbo")); }