CommandExecutorImpl implements CommandExecutor { @Override public CommandResult execute( final String hostId, final RequestBuilder requestBuilder ) throws CommandException { return execute( hostId, requestBuilder, new DummyCallback() ); } CommandExecutorImpl( CommandProcessor commandProcessor ); @Override CommandResult execute( final String hostId, final RequestBuilder requestBuilder ); @Override CommandResult execute( final String hostId, final RequestBuilder requestBuilder,
                                  final CommandCallback callback ); @Override void executeAsync( final String hostId, final RequestBuilder requestBuilder ); @Override void executeAsync( final String hostId, final RequestBuilder requestBuilder, final CommandCallback callback );  }
@Test public void testExecute() throws Exception { commandExecutor.execute( HOST_ID, requestBuilder ); verify( commandProcessor ).execute( any( Request.class ), any( CommandCallback.class ) ); verify( commandProcessor ).getResult( any( UUID.class ) ); }
@Test public void testExecute2() throws Exception { commandExecutor.execute( HOST_ID, requestBuilder, callback ); verify( commandProcessor ).execute( any( Request.class ), eq( callback ) ); verify( commandProcessor ).getResult( any( UUID.class ) ); }