OnDemandBindingGoro extends BufferedGoroDelegate implements ServiceConnection { @Override public final <T> ObservableFuture<T> schedule(final String queueName, final Callable<T> task) { ObservableFuture<T> result = super.schedule(queueName, task); bindIfRequired(); return result; } OnDemandBindingGoro(final Context context); @Override final void addTaskListener(final GoroListener listener); @Override final void removeTaskListener(final GoroListener listener); @Override final ObservableFuture<T> schedule(final String queueName, final Callable<T> task); @Override final Executor getExecutor(final String queueName); @Override void onServiceConnected(final ComponentName name, final IBinder binder); @Override void onServiceDisconnected(final ComponentName name);  }
@Test public void scheduleShouldBeDelegated() throws Exception { Callable<?> task = mock(Callable.class); goro.schedule("2", task); testingQueues.executeAll(); verify(task).call(); }