@Test public void shouldPrintHistoryCorrectlyNumberedFrom1() throws CommandException { when(historian.getHistory()).thenReturn(Arrays.asList(":help", ":exit")); cmd.execute(""); verify(logger).printOut(eq(" 1 :help\n" + " 2 :exit\n")); }
@Override public void execute(@Nonnull String argString) throws ExitException, CommandException { simpleArgParse(argString, 0, COMMAND_NAME, getUsage()); int lineCount = 16; logger.printOut(printHistory(historian.getHistory(), lineCount)); }
History implements Command { @Override public void execute(@Nonnull String argString) throws ExitException, CommandException { simpleArgParse(argString, 0, COMMAND_NAME, getUsage()); int lineCount = 16; logger.printOut(printHistory(historian.getHistory(), lineCount)); } }
History implements Command { @Override public void execute(@Nonnull String argString) throws ExitException, CommandException { simpleArgParse(argString, 0, COMMAND_NAME, getUsage()); int lineCount = 16; logger.printOut(printHistory(historian.getHistory(), lineCount)); } History(@Nonnull final Logger logger, @Nonnull final Historian historian); }
History implements Command { @Override public void execute(@Nonnull String argString) throws ExitException, CommandException { simpleArgParse(argString, 0, COMMAND_NAME, getUsage()); int lineCount = 16; logger.printOut(printHistory(historian.getHistory(), lineCount)); } History(@Nonnull final Logger logger, @Nonnull final Historian historian); @Nonnull @Override String getName(); @Nonnull @Override String getDescription(); @Nonnull @Override String getUsage(); @Nonnull @Override String getHelp(); @Nonnull @Override List<String> getAliases(); @Override void execute(@Nonnull String argString); }
History implements Command { @Override public void execute(@Nonnull String argString) throws ExitException, CommandException { simpleArgParse(argString, 0, COMMAND_NAME, getUsage()); int lineCount = 16; logger.printOut(printHistory(historian.getHistory(), lineCount)); } History(@Nonnull final Logger logger, @Nonnull final Historian historian); @Nonnull @Override String getName(); @Nonnull @Override String getDescription(); @Nonnull @Override String getUsage(); @Nonnull @Override String getHelp(); @Nonnull @Override List<String> getAliases(); @Override void execute(@Nonnull String argString);  }