taskManager.enqueue( action );
taskManager.enqueue( action );
// TODO: implement a deterministic executor service for testing..
ExecutorService pool = Executors.newSingleThreadExecutor();
ExternalExecutorService service = new ExternalExecutorService( pool );
// set the pool
manager.setPool( service );
// enqueue after setting the pool
taskManager.enqueue( action );
taskManager.enqueue( action );
taskManager.enqueue( action );
// executes all pending actions using current thread
service.waitUntilEmpty();
pool.shutdown();
// check expectations
verify( action, times(5) ).execute(workingMemory);
}