@Test public void testExecute() { when(command.execute(context)).thenReturn(commandResult); CommandResult<Object> result = tested.execute(context, command); verify(command, times(1)).execute(eq(context)); verify(command, times(0)).allow(anyObject()); verify(command, times(0)).undo(anyObject()); assertNotNull(result); assertEquals(commandResult, result); }
@Override public CommandResult<V> execute(final C context, final Command<C, V> command) { return command.execute(context); }
CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> execute(final C context, final Command<C, V> command) { return command.execute(context); } }
CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> execute(final C context, final Command<C, V> command) { return command.execute(context); } CommandManagerImpl(); }
CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> execute(final C context, final Command<C, V> command) { return command.execute(context); } CommandManagerImpl(); @Override CommandResult<V> allow(final C context,
                                  final Command<C, V> command); @Override CommandResult<V> execute(final C context,
                                    final Command<C, V> command); @Override CommandResult<V> undo(final C context,
                                 final Command<C, V> command); }
CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> execute(final C context, final Command<C, V> command) { return command.execute(context); } CommandManagerImpl(); @Override CommandResult<V> allow(final C context,
                                  final Command<C, V> command); @Override CommandResult<V> execute(final C context,
                                    final Command<C, V> command); @Override CommandResult<V> undo(final C context,
                                 final Command<C, V> command);  }