BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();
client.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK", responseHandler);
List<TaskSummary> tasks = responseHandler.getResults();
assertEquals(1, tasks.size());
TaskSummary task = tasks.get(0);
assertEquals("TaskName", task.getName());
assertEquals(10, task.getPriority());
assertEquals("Comment", task.getDescription());
assertEquals(Status.Ready, task.getStatus());
System.out.println("Claiming task " + task.getId());
BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
client.claim(task.getId(), "Darth Vader", operationResponseHandler);
operationResponseHandler.waitTillDone(5000);
System.out.println("Claimed task " + task.getId());
System.out.println("Starting task " + task.getId());
operationResponseHandler = new BlockingTaskOperationResponseHandler();
client.start(task.getId(), "Darth Vader", operationResponseHandler);
operationResponseHandler.waitTillDone(5000);
System.out.println("Started task " + task.getId());
System.out.println("Completing task " + task.getId());
operationResponseHandler = new BlockingTaskOperationResponseHandler();
client.complete(task.getId(), "Darth Vader", null, operationResponseHandler);
operationResponseHandler.waitTillDone(5000);
System.out.println("Completed task " + task.getId());
assertTrue(manager.isCompleted());
}