CreateCachedCollectionTask implements IDatabaseTask { @Override public void execute() throws TaskExecutionException { createCollectionTask.execute(); } CreateCachedCollectionTask(final IDatabaseTask createCollectionTask); @Override void prepare(final IObject query); @Override void execute();  }
@Test public void MustCorrectCallExecuteTargetTask() throws TaskExecutionException { testTask.execute(); verify(task).execute(); }
@Test(expected = TaskExecutionException.class) public void MustInCorrectCallExecuteTargetTaskWhenTargetTaskThrowException() throws TaskExecutionException { doThrow(TaskExecutionException.class).when(task).execute(); testTask.execute(); }